Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
  <style>
    .container { margin-top:20px; border:1px solid; padding:10px}
    
    .style1 {background:tomato; color:#fff;}
    .style2 {background:#222; color:whitesmoke;}
  </style>
  
  <script>
    $(function() {
    $( ".theme1" ).click(function() {
      $( ".container" ).toggleClass("style1");
      $( ".container" ).removeClass("style2");
    });
      $( ".theme2" ).click(function() {
      $( ".container" ).toggleClass("style2");
      $( ".container" ).removeClass("style1");
    });
  });
  </script>
</head>
<body>
  Please Choose:
  <a href="#" class="theme1">Style 1</a> or
  <a  href="#" class="theme2">Style 2</a>
  <div class="container">
    I'm the container
  </div>
</body>
</html>
Output

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers