assign value to id in jquery code example
Example 1: add id jquery
$('element').attr('id', 'value');
Example 2: jquery set input value
$("button").click(function(){
$("input:text").val("Glenn Quagmire");
})
Example 3: how to add id in jquery
var $newdiv1 = $( "<div id='object1'></div>" ),
newdiv2 = document.createElement( "div" ),
existingdiv1 = document.getElementById( "foo" );
$( "body" ).append( $newdiv1, [ newdiv2, existingdiv1 ] );