Tag: apply css in div using JQuery library

How can we apply css in div element using JQuery library.

December 26, 2009 | Filed Under JQuery | Leave a Comment

This is example to apply css on a div element which have id name myDivId.
$(”#myDivId “).css(”border”,”3px solid red”);

To apply css on all div elements use below code.
$("div").css("border","3px solid red");
Where
$("div") pointing all div elements in the page.
For <P> You need to use.

$(”P”) on above code.

Article written by urooj

© PHPInterviewQuestion.com 2009 - 2010

eXTReMe Tracker