How to set the id and class name of a <DIV>?

bornagainvet

New Member
Mine is a simple enough question but i tried different ways they did work out.. I have following code . I am creating new \[code\]<div>\[/code\] and trying to give it a class name test.So when i click on this \[code\]<div>\[/code\] with class test i am trying to rise alert... Please help me i ma lost....\[code\]$('.item').click(function(){ if(!isFullscreen){ // MAXIMIZATION $boxes = $(this).css('width','100%'); $boxes.addClass("test"); //$boxes.id = "test"; $('#content').prepend( $boxes ).masonry( 'reload' ); }});$(".test").click(function(){ alert("Test");});\[/code\]I even tried below code: but they did not work\[code\] //$boxes.className="test"; //jQuery($boxes).attr("id","test");\[/code\]Thanks in advance...
 
Back
Top