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
What is escape data in php?
What are some new features introduced in php7?
Explain Constant in Class?
What is substr in php?
Is server side a session?
How do I run php?
Which is better get or post method?
What does type casting mean in php? Explain with an example?
What language is similar to php?
Write a program in php to print a table of a number?
What is the use of $_server["php_self"] variable?
What is the difference between unset and unlink?
Explain the difference between array_merge() and array_combine()?
How to get ip address of clients machine?
How long is csrf token?