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
How to get a total number of elements used in the array?
What is regex in html?
Write a program using while loop?
What is good average session duration?
What is the difference between die () and exit () in php?
Why use static methods php?
What are the difference between abstract class and interface in oops?
Explain how to run the interactive php shell from the command line interface?
What is the correct syntax of mail() function in php?
What is the method to execute a php script from the command line?
What is difference between require_once(), require(), include()?
What is php explain?
How to execute an sql query?
What is the difference between get and post method in php?
What is the function file_get_contents() useful for?