I'm using the jQuery script listed bellow in order to select a few checkbox inputs.
$(document).ready(function() {
$("input:checkbox:not(:checked)").each(function() {
var column = "table #" + $(this).attr("name");
$(column).hide();
});
$("input:checkbox").click(function(){
var column = "table #" + $(this).attr("name");
$(column).toggle();
});
});
How can I modify the script in order to get only the those checkboxes where there name starts with "col_"?
Thank you!
You can choose attribute with ^=
to indicate prefix $=
suffix etc
http://api.jquery.com/category/selectors/
$('input:checkbox[name^=col_]')