HTML

 

<select id="keys">
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
</select>

<div id="example"></div>


JQuery

$(document).ready(function() {
$("#keys").change(function(){
$('#example').empty();
var selectedKey = $(this).val();
$('#example').append(selectedKey);
});
});

 

JQuery Library

https://code.jquery.com/jquery-1.7.2.js

Advertisements