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
How we get ip address of client, previous reference page etc?
How can you propagate a session id?
What is associative array in php?
Tell me what is htaccess?
What is difference between variable declaration and variable definition?
How can we extract string "pcds.co.in" from a string "https://info@pcds.co.in" using regular expression of php? More on reg can you explain
Explain what is the difference between for and foreach?
How can I learn php fast?
How to get ip address of a server in php?
What is session data?
What is sorting php?
What are the methods of array in java?
How to send email using php script?
How to set a page as a home page in a php based site?
Explain php parameterized functions.