vendredi 18 mars 2016

why doesnt document.getElementbyID find the checkbox input [on hold]

this is my HTML:

<div class="form-item form-type-checkbox form-item-assetnotneeded">
  <input type="checkbox" class="form-checkbox" value="1" name="assetnotneeded" id="edit-assetnotneeded" title="checkbox: assetnotneeded">  <label for="edit-assetnotneeded" class="option">Asset Tag Not Necessary </label>
</div>

yet when I run this javascript, I get null

var el = document.getElementById('edit-assetnotneeded');
alert ("el is "+el);

Why do I get null?




Aucun commentaire:

Enregistrer un commentaire