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
What does mvc stand for and what does each component do?
Which function parses an English textual date or time into Unix timestamp in PHP.
What is lazy loading in php?
How to get elements in reverse order of an array in php?
What is difference between isset and empty in php?
How to read a file in binary mode?
What is the correct line to use within the php.ini file, to specify that 128mb would be the maximum amount of memory that a script may use?
Explain how is it possible to cast types in php?
What is the function file_get_contents() usefull for?
Explain converting an object?
How to Retrieve a Cookie Value?
Applications written to provide a GUI shell for Unix and Linux are called
Do you know when sessions ends?
What is php explain?
What is super keyword in c++?