Adding options to Listbox

Add text and submit to enter as option

Name
Click to Add
Student List
<script>
$(document).ready(function() {
$("#b1").click(function(){
var to_add = $("#t1").val();
$("#student").append("<option value='" + to_add +"'>"+to_add+"</option>");
$("#t1").val('');
$("#student").val(to_add); 
});
});
</script>