We would like to know how to click to add border.
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
src='http://code.jquery.com/jquery-1.6.2.js'></script>
<style type='text/css'>
div {<!-- www . ja v a 2 s.c o m-->
float: left;
padding: 10px;
background-color: #bbe;
}
</style>
<script type='text/javascript'>
$(window).load(function(){
$('div').click(function(){
$(this).css("border","solid 1px green");
});
});
</script>
</head>
<body>
<div>click me</div>
</body>
</html>
The code above is rendered as follows: