Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

display selected value in dropdown list through javascript
without page refresh

Answer Posted / drorasta

you don't need to use AJAX for this. Just a simple
javascript:

<html>
<body>

<script type="text/javascript">
function showSelected(val){
document.getElementById
('selectedResult').innerHTML = "The selected number is - "
+ val;
}
</script>

<div id='selectedResult'></div>

<select name='test' onChange='showSelected(this.value)'>
<option value='1'>one</option>
<option value='2'>two</option>
</select>

</body>
</html>

Is This Answer Correct ?    375 Yes 116 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does cors prevent csrf?

1010


Is array empty php?

957


Write a program to get lcm of two numbers using php?

1006


What is $_ env in php?

1036


How to replace a substring in a given string?

1200


How stop the execution of a php scrip?

1067


What is the use of trim function in php?

1017


What does echo mean in php?

1077


What are the different data types in javascript?

2146


Can we override static method?

1015


How do you call a constructor for a parent class?

951


What is the use of the function htmlentities?

1153


for image work which library?

1018


What is the difference between $argv and $argc? Give example?

1050


> symbol is used to redirect the output of a command. State Whether True or False?

1196