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
Can the value of a constant change during the script's execution?
What is a null coalescing operator in php7?
Write a program using while loop in php?
Are php short tags acceptable to use?
What function do we use to find length of string, and length of array?
What is difference between get and post in php?
What is the use of friend function in php?
What are the common uses of php?
Tell me what is the meaning of a final class and a final method?
What is difference between mysql_connect and mysqli_connect?
Which of the data type is compound datatype supported by PHP?
What is the main difference between require() and require_once()?
What is the use of @ in php?
How error handling is being handled by php?
What are the php variables?