Getting & setting selected option of a Listbox

On Select of listbox ( student ) , text box value ( data ) along with selection of second list ( student2 ) box will change.

Student Name
Details
Student2
<script>
$(document).ready(function() {
$("#student").change(function(){ // change function of listbox
var sel = $("#student").val(); // reading listbox selection
$("#t1").attr('value',sel); // keeping in a text box
$("#student2").val(sel); // Change the selection of list box 
});
});
</script>