jquery add id value to element code example
Example 1: add id jquery
$('element').attr('id', 'value');
Example 2: how to add id in jquery
$( "li" ).add( "<p id='new'>new paragraph</p>" )
.css( "background-color", "red" );
$('element').attr('id', 'value');
$( "li" ).add( "<p id='new'>new paragraph</p>" )
.css( "background-color", "red" );