How to add html table id using jquery
3 answers
Using jQuery attr () you can add an id for the table, this is where you need to consider which table you have selected to add the id. Try fiddle , in this example I re-validate the id to confirm it was added.
$('table').attr('id','idForTable');
var a = document.getElementsByTagName('table')[0];
alert($(a).attr('id'))
0
source to share