Set border
Description
The following code shows how to use jQuery to set border.
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() {<!--from w ww . j a va2s .c o m-->
$("div").css("background", "blue").filter(function(index) {
return $(this).attr("id") == "fourth";
}).css("border", "1px solid red");
});
</script>
<style>
div {
border: 2px white solid;
}
</style>
</head>
<body>
<body>
<div id="first">java2s.com</div>
<div id="second">java2s.com</div>
<div id="third">java2s.com</div>
<div id="fourth">java2s.com</div>
<div id="fifth">java2s.com</div>
<div id="sixth">java2s.com</div>
</body>
</html>