'checked' is null or not an object - only IE

Posted by Srinath on Stack Overflow See other posts from Stack Overflow or by Srinath
Published on 2010-06-18T13:14:53Z Indexed on 2010/06/18 13:23 UTC
Read the original article Hit count: 257

Filed under:
|

Hi This problem exists only in IE browser, in mozilla its working fine... i have to delete a row on click on checkbox.... Here is my code :

<table width="100%" id="seller">
<tr id="row_1" class="row">
 <td><input type="checkbox" name="delete" id="delete" value="1" /></td>
</tr>
<tr id="row_2" class="row">
 <td><input type="checkbox" name="delete" id="delete" value="2" /></td>
</tr>
</table>
<input type="button" id="delete" name="delete" value="Delete" onclick="delete_row('seller')"/>

    var delete_ids = [];
    function delete_row(tableID){
      var rows = document.getElementsByClassName('row');
      var delItems = document.getElementsByName('delete');

      for(var i=0;i < rows.length;i++){
      alert(delItems[i].checked);
        if(delItems[i].checked == true){
          delete_ids.push(rows[i].id);
          jQuery(rows[i]).remove();
          i = i-1;
        }
      }
}

Showing error on page : 'checked' is null or not an object.
can one please tell me the fix .

thanks in advance, sri..

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about ie