Add new element and set CSS property
Description
The following code shows how to add new element and set CSS property.
Example
<html>
<head>
<script
src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {<!-- w w w. j a v a2 s .c o m-->
$("div").add("p").css("background", "yellow");
});
</script>
</head>
<body>
<div>java2s.com</div>
<div>java2s.com</div>
<div>java2s.com</div>
<div>java2s.com</div>
</body>
</html>