Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <form name = "f1">
    <input type="radio" name="r1" Value="Input" onClick="GetSelectedItem(this)"> Input
    <input type="radio" name="r1" Value="Output" onClick ="GetSelectedItem(this)"> Output
  </form>
  <div id="output"></div>
<script> 
var output = document.getElementById('output');
function GetSelectedItem(el) {
    output.innerHTML = el.value;
  
    if (el.value == "Input") {
      alert(el.value);  
    } else if(el.value == "Output") {
      alert(el.value);
    }
}
</script>
</body>
</html>
Output

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

Dismiss x
public
Bin info
_alexander_pro
0viewers