
how to select an item from the dropdownlist when we load the page

Hi Friend,
Try the following code:
<html>
<head>
<script>
function sel(){
var v = document.getElementById("sel");
var str = v.options[v.selectedIndex].value;
alert(str);
}
</script>
</head>
<select name="sel" id="sel" onchange="sel();"
>
<option value="C">C</option>
<option value="JAVA">JAVA</option>
<option value=".NET">.NET</option>
<option value="PERL">PERL</option>
</select>
</html>
Thanks
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.