Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
  <style>
  .box2 {
    color: red;
   }
  
  </style>
</head>
<body>
  <div class="box1">Story 1</div>
<div class="box2">Story 2</div>
<div class="box2">Story 3</div> 
<div class="box2">Story 4</div>  
</body>
</html>
 
$("div").on("click",function(){
  $(".box1").prop("class","box2");
  $(this).prop("class","box1");
});
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers