how to bind newly created html element to its css

MaxTunk

New Member
i am adding dynamically new html elements thru javascript, and those newly created html elements have a css class which already exists in a linked style.css file. how do i let this newly created element know about his css class, so that the styling by this class can effect the newly created html element. my js: \[code\]for(k=1;k<=5;k++){ if(k==data['price']){html = html + '<input class=\"star\" type=\"radio\" name=\"test-5\" disabled=\"disabled\" value=http://stackoverflow.com/"'+k+'\" checked=\"checked\" />'; }else{html = html + '<input class=\"star\" type=\"radio\" name=\"test-6\" disabled=\"disabled\" value=http://stackoverflow.com/"'+k+'\"/>'; } }\[/code\]that class \[code\]star\[/code\] should be popular to css file right after its creation. is there any \[code\]make-popular\[/code\] function in jquery or so? hope that i explained my problem well.. thanks
 
Back
Top