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>
</head>
<body>
  
  <select id="mySel">
    <option>a</option>
    <option>b</option>
    <option>c</option>
    <option>d</option>
    <option>e</option>
    <option>f</option>
  </select>
  
  <label for="mySel">
    
  </label><br/>
  
  <input type="radio" id="radioId1" name="radioGroupId"/>
  <input type="radio" id="radioId2" name="radioGroupId"/>
</body>
</html>
 
$(document).ready(function(){
  $('#mySel').change(function(){
    var value = $(this).val();
    console.log(value);
    $('label').text(value);
    var radio;
    // if selection is a b or c
    if("abc".indexOf(value) !== -1){
      radio = $('#radioId1');
    } else {
      radio = $('#radioId2');
    }
    radio.prop('checked', true);
  });
});
Output 300px

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

Dismiss x
public
Bin info
anonymouspro
0viewers