display selected value in dropdown list through javascript
without page refresh
Answer Posted / dhir
<html>
<body>
<script type="text/javascript">
var show
function showSelected()
{
show
=document.me.test.options[document.me.test.selectedIndex].value;
document.write(show);
}
</script>
<form name="me">
<select name='test' onChange='showSelected()'>
<option value='1'>one</option>
<option value='2'>two</option>
</select>
</form>
</body>
</html>
| Is This Answer Correct ? | 169 Yes | 102 No |
Post New Answer View All Answers
When viewing an html page in a browser, the browser often keeps this page in its cache. What can be possible advantages/disadvantages of page caching? How can you prevent caching of a certain page (please give several alternate solutions)?
How can we calculate the similarity between two strings?
Is PHP an open source software?
What is __ invoke in php?
What is the difference between require_once and require in php?
What is the default time in seconds for which session data is considered valid?
Which one is best framework for php?
What is good average session duration?
Why use static methods php?
What is inheritance in php with example?
What is a composer?
Explain what does the expression exception::__tostring means?
What is final class and final method in php?
Tell me how to find the position of the first occurrence of a substring in a string?
Is php a mvc?