Java Script on click Events

Onclick Event

<script>
function myclick() {
var x = document.getElementById("msg").value;
document.getElementById("demo").innerHTML = x;
}
</script>

Onclick Events

<script>
function myclick(){
var x = document.getElementById("name").value;
var y = "Ravi"
if (x == y) {
document.getElementById("msg").innerHTML = "Value Mach";
}
else{
document.getElementById("msg").innerHTML = "Value does not mach";
}
}
</script>

More

Leave a Reply

Your email address will not be published. Required fields are marked *