Welcome aboard! We are happy you are here and wish you good net-raft!
<!DOCTYPE html>
<html>
<body>
<button onclick="function1()">Try it</button>
<div id="test"></div>
<script>
function function1() {
var text;
var mylang = prompt("What's your favorite programming language?", "Javascript");
switch(mylang) {
case "Java":
text = "Java is my favorite too!";
break;
case "Javascript":
text = "Javascript is the best!";
break;
case "PHP":
text = "PHP is really crazy!";
break;
default:
text = "I have never heard of that one ..";
}
document.getElementById("test").innerHTML = text;
}
</script>
</body>
</html>
The most helpful JAVASCRIPT solutions
How can I get the last day and the next day in javascript ?JAVASCRIPT Click to see more ... 5.8K 507