How to use Alternate text of button by clicking?
Example :
<html>
<head>
<title>Alternate text in Button</title>
<link rel="stylesheet" href="style.css">
<style>
div{background-color:lightgrey;}
</style>
<script>
function change_text()
{
var x=document.getElementById("btn").value;
if(x=="hello")
{
document.getElementById("btn").value="compuhelp";
}
else
{
document.getElementById("btn").value="hello";
}
}
</script>
</head>
<body>
<h2>Q5.Alternate text of button by clicking</h2>
<div>
<input type="button" value="hello" id="btn" onclick="change_text()">
</div>
</body>
</html>