display selected value in dropdown list through javascript
without page refresh

Answer Posted / apeksha

<HTML>
<BODY>

<SCRIPT>
function getSelect(s)
{
return s.options[s.selectedIndex].value
}
</SCRIPT>


<SELECT NAME="list" OnChange="location=getSelect(this)">
<OPTION value="#"> Choose a search engine
<OPTION value="http://www.yahoo.com"> Yahoo
<OPTION value="http://www.lycos.com"> Lycos
<OPTION value="http://www.excite.com"> Excite
</SELECT>


</BODY>
</HTML>

Is This Answer Correct ?    102 Yes 58 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can the value of a constant change during the script's execution?

749


What is a null coalescing operator in php7?

918


Write a program using while loop in php?

749


Are php short tags acceptable to use?

725


What function do we use to find length of string, and length of array?

718


What is difference between get and post in php?

816


What is the use of friend function in php?

741


What are the common uses of php?

768


Tell me what is the meaning of a final class and a final method?

796


What is difference between mysql_connect and mysqli_connect?

697


Which of the data type is compound datatype supported by PHP?

773


What is the main difference between require() and require_once()?

756


What is the use of @ in php?

771


How error handling is being handled by php?

767


What are the php variables?

733