By 17/02/2016 25 Comments

Prompt Dialog Box In JavaScript

Example:

<!DOCTYPE html>
<html>
<body>
<script>
function askFromMe() {
 var result;
 var favLanguage = prompt("What's your favorite programming language?");
 switch(favLanguage) {
 case "php":
 result = "PHP is your favourite!";
 break;
 case "javascript":
 result = "JavaScript is your favourite!";
 break;
 case "jquery":
 result = "JQuery is your favourite!";
 break;
 default:
 result = "You did not enter any language!";
 }
 document.getElementById("display").innerHTML = result;
}
</script>
<p> Tell us about your favourite programming language?</p>
<button onclick="askFromMe()"> Give an answer </button>
<p id="display"></p>

</body>
</html>






Posted in: HTML, JavaScript, Solutions

Leave your valuable Comment

Have a natural attraction for women cosmetics and replica watches uk clothes, no
more than two for men the most attractive one, is to make their own driving experience, happy and can serve as the facade of the car, another is to highlight the taste edify sentiment rolex replica watch. The replica rolex is undoubtedly the most fashionable accessories, wear a suit to attend the activities, but also get a decent match on the replica watches .