Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  options: <select id="selection">
  <option value="0">Select</option>
    <option value="1">Car</option>
    <option value="2">Plane</option>
    <option value="3">Boat</option>
  
</select>
<div id='car'>you have chosen a car</div>
<div id='plane'>you have chosen a plane</div>
<div id='boat'>you have chosen a boat</div>
</body>
</html>
 
#car, #plane, #boat {
  display: none;
}
 
$(function(){
  
  $("#selection").on("change", function(){
  
    if ($(this).val() == 0) {
  
      $("#car, #plane, #boat").hide();
      
    } else if ($(this).val() == 1) {
  
      $("#plane, #boat").hide();
      
      $("#car").fadeIn();
      
    } else if ($(this).val() == 2) {
  
      $("#car, #boat").hide();
      $("#plane").fadeIn();
      
    } else {
  
      $("#car, #plane").hide();
      $("#boat").fadeIn();
    }  
  });
});
Output 300px

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

Dismiss x
public
Bin info
anonymouspro
0viewers