Change <h1> using <select> then remove <select>

by alano

HTML

<h1>Choose Staff on the right </h1>  
<select>
    <option>Choose Staff Name</option>
    <option>james</option>
    <option>alex</option>
</select>
<br/>
<h1>Choose First Language on right </h1>  
<select>
    <option>Choose First language</option>
    <option>English</option>
    <option>German</option>
</select>

CSS

h1 { display: inline; }

JavaScript

$(document).ready(function() {
    $("select").change(function() {
        $(this).prev("h1").text($(this).val()); //set text using select's value
        $(this).remove(); //remove self (the "select")
    });
});