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


Please Help Members By Posting Answers For Below Questions

How do you end php?

745


What is framework? How it works? What is advantage?

734


How do you define a constant?

753


What is isset php?

728


What is pdo classes?

793


Is php an api?

741


How do sessions work in php?

738


How can i execute PHP File using Command Line?

720


What is a lambda function in php?

851


Tell me how to create a session? How to set a value in session? How to remove data from a session?

726


Name some of the popular frameworks in php.

755


How can we submit form without a submit button?

768


What is csrf token and how will you add csrf token in ajax?

722


What is the use of 'print' in php?

808


What's the difference between using mysql_ functions and pdo?

779