
To select an element having a specific id, ID selector can be used. We need to prefix the id with “#”
(hash symbol).
<script language="javascript" type="text/javascript">
$("#p1").css("border", "5px solid green");
</script>
Above code will select all html elements having id attribute as “p1” and apply css style border width as 5 pixel, style as solid and color as green.
Views: 7070 | Post Order: 13