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>
<script>
  function showOptions(s) {
  console.log(s[s.selectedIndex].value); // get value
  console.log(s[s.selectedIndex].id); // get id
}
</script>
<select  onchange="showOptions(this)" id="my_select2">
   <option value="b1" id="idb1">Option1</option>
   <option value="b2" id="idb2">Option2</option>
</select>
  
  
</body>
</html>
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers