lundi 29 juin 2015

document.getElementById is not working (Object doesn't support property or method 'getElementById')

The element that im trying to get is a checkbox, the content of the page is dynamically created by using ASP.Net.

here is the line where IE11 breaks;

<TD>
    <span id="spnFaxSelected" style="HEIGHT: 100%">
        <span class="">
            <input onclick="document.getElementById(&quot;COIÑAPPÑfax&quot;).checked=this.checked;document.getElementById(&quot;COIÑAPPÑfax&quot;).value=(this.checked)?&#39;on&#39;:&#39;off&#39;;OpenTransaction(this);"
                type="checkbox" id="COIÑAPPÑfax~chk" disabled="disabled" style="BACKGROUND-COLOR:#e4e4e4;" />
            <label for="COIÑAPPÑfax~chk">Fax</label>
            <input id="COIÑAPPÑfax" name="COIÑAPPÑfax" type="hidden" value="off" CAType="CACheckBox" onpropertychange="caCheck()" />
        </span>
    </span>
</TD>

the error that im getting in IE11 debugger is

Object doesn't support property or method 'getElementById'

Any one encountered this problem before?

EDIT: The code works fine in IE9, doesnt work in IE11

Aucun commentaire:

Enregistrer un commentaire