Select all Checked Checkboxes with Name Not Working

I must have my syntax incorrect, but I am trying to select all checked checkboxes in a table with the name "clone" and loop through them, but my code isn't working. Any help would be appreciated.

$('input[type="checkbox"][name="clone"]:checked').each(function(index, element) {
     alert( index );        
}); 

Also I was planning to append the table with selected rows one by one using the code below where the alert is. Please also let me know if there is a better way to do this as I am fairly new to Jquery.

$('#wizard_option_table').append( $(this).parents("tr:first") );

Answers


check jsFiddle
jQuery
 $('input[type="checkbox"][name="chkbx\\[\\]"]').not(":disabled"));

In question try this

 $('input[type="checkbox"][name="clone\\[\\]"]').not(":disabled"));

first you get the checked element value,then append where you want

$('input[type="checkbox"][name="clone"]:checked').each(function(i){
    alert($(this).val());   // here you get checked check box values
    $('#wizard_option_table tbody').append( '<tr><td>'+$(this).val()+'</td></tr>');
    // you can use append, or prepend http://api.jquery.com/prepend/    
});

Need Your Help

What is the code for an rss reader that only accesses local content?

javascript rss intranet

I need an rss reader for viewing feeds on our Intranet. The only rss readers I've found can only read web based feeds. I want to place the rss reader within an &lt;iframe&gt; or &lt;object&gt; wi...

Conflict of tracking reference in c#

c# .net c++-cli

I wrote managed class in C++/CLI: