# Firefox Javascript does not work

**URL:** <https://forum.kirupa.com/t/firefox-javascript-does-not-work/194109>\
**Category:** web dev\
**Created:** [July 20, 2006, 4:45pm UTC](https://forum.kirupa.com/t/firefox-javascript-does-not-work/194109 "2006-07-20T16:45:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lwenkel](https://avatars.discourse-cdn.com/v4/letter/l/f07891/32.png) [@lwenkel](https://forum.kirupa.com/u/lwenkel)\
**Post date:** [July 20, 2006, 4:45pm UTC](https://forum.kirupa.com/t/firefox-javascript-does-not-work/194109/1 "2006-07-20T16:45:41Z")

</div>

This Javascript code gives a “imgobj has no properties” in second line “if” statement in Firefox:

function setSelectedElem(evt) {

var imgObj = (evt.imgObj) ? evt.imgObj : evt.srcElement;  
**if (imgObj.parentNode.id.indexOf(“dragimg”) != -1)** {  
selectedObj = imgObj.parentElement.style;  
setZIndex(selectedObj,100);  
return;  
}  
selectedObj = null;  
return;  
}

I am trying to convert this code to work in Firefox that currently only works in IE.
