<html>
<head>
<styles>
.option
{
background-color:red;
margin: 10px auto;
}
.option.active
{
background-color: blue;
}
</styles>
</head>
<body>
<div class="option first">1</div>
<div class="option second">2</div>
<div class="option third">3</div>
<div class="option fourth">4</div>
<script>
$(document).ready(
function()
{
$(".option").click(
function(event)
{
$(this).addClass("active").siblings().removeClass("active");
}
);
});
</script>
</body>
</html>
0 comments:
Post a Comment
Note: only a member of this blog may post a comment.