
I have a dropdown with four options, each time I select an option a new text box should open below. please guide.In urgent need.

The given code displays the dropdown list and allow the user to use onchange event. As the user clicks the button, everytime a textbox will get displayed.
<html>
<script>
function generateTextbox(){
var d=document.getElementById("div");
d.innerHTML+="<p><input type='text' name='lang'></p>";
}
</script>
<select name="sel" onchange="generateTextbox();">
<option value="C/C++">C/C++</option>
<option value="Java">Java</option>
<option value="Pascal">Pascal</option>
<option value="Perl">Perl</option>
</select>
<br>
<div id="div">
</div>
</html>

but I dont want the textboxes to accumulate.one textbox every time an option is selected.