Please login to start chat

ICT Solutions 25 Jun 2022, 11:35:20
Category : JavaScript Tutorials

onchange (HTML DOM Events)

<!DOCTYPE html>
<html>
<head>
<title>JS Code Testing</title>
</head>
<body>
<select id = "myId" onchange = "jsFun()">
<option value = "#">Choose Options</option>
<option value = "Thet">Thet</option>
<option value = "Naing">Naing</option>
<option value = "Win">Win</option>
</select>
<p id = "demo"></p>
<script>
function jsFun(){
var x = document.getElementById("myId").value;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>

Comments:

No comment to show.

Available Services
Download Android Application