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
Does cors prevent csrf?
Is php strongly typed?
How do I run a php script in windows?
Is php closing tag necessary?
A process can run only in the background. State Whether True or False?
What happens when submit button is clicked?
What is difference between include,require,include_once and require_once()?
What is use of count() function in php?
Does php support inheritance?
Which array function checks if the particular key exists in the array?
How to create an empty array in php?
What is binary safe function in php?
Explain how can php and javascript interact?
What are the methods of array in java?
What is php string function?