tags:

views:

28

answers:

1

I'm successfully inserting a row into my table via

$('#fbs tr:last').after('<tr><td><input id="vm" type="checkbox" /></td></tr>');

However after that I'm trying to select $('#vm') and not receiving anything. Everything looks right but jQuery isn't finding the element.

+1  A: 

The following alerts one, please post more code:

<html>
  <head>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt;
<script type="text/javascript">
$(document).ready(function() {
     $('#fbs tr:last').after('<tr><td><input id="vm" type="checkbox" /></td></tr>');
     alert($('#vm').length);
});
</script>
  </head>
  <body>
      <table id="fbs">
        <tr><td>first</td></tr>
      </table>
  </body>
</html>
Yuriy Faktorovich
Yep totally my fault in the markup. This does work!
RailRhoad