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
Explain the differences between get and post methods?
Explain the installation of PHP on UNIX systems?
How can we calculate the similarity between two strings?
Which operator is used to concatenate two strings in PHP?
Explain me what is sql injection?
Do you know how to declare an array in php?
Is empty check in php?
What is the php function that removes the first element of the array and returns it?
What is in php 7?
What is the use of array_count_values() in php?
How to remove duplicate values from array using php?
What the use of var_dump()?
Why do we use csrf token?
Could we start a variable with number like $4name?
What are global variables in php?