Home >> Javascript >> Onchange event in Javascript

Onchange event in Javascript

An HTML element has been changed.
 
<script type = "text/javascript">
function findCountry(country) {
   alert country;
}
</script>      
 
<p>Select the following country and see result</p>      
<form>
 <select name="country" onchange = "findCountry(this.value)">
      <option value="">Select Country</option>
     <option value="India">India</option>
     <option value="USA">USA</option>
     <option value="UK">UK</option>
 </select>
</form>      

Post Your Comment

Next Questions
Onclick event
Onmouseover event
Onmouseout
Onkeydown event
Onload event

Copyright ©2022 coderraj.com. All Rights Reserved.