Wednesday, October 5, 2016

Greet Me in Jquery

A simple script that I wrote using JQuery that will ask the user's name and then our program will say Hello How are you to the user. It shows how to accept input values such as string and display using JQuery as our JavaScript library.

Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com. 

My email address are the following 
jakerpomperada@gmail.com and jakerpomperada@yahoo.com. 
My mobile number here in the Philippines is 09173084360.



Program Listing

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $("form").submit(function(){
        var names=  document.getElementById("fname").value;
        alert("Hello " + names + "How are you?");
    });
});
</script>
</head>
<body>

<form action="">
What is your name <input type="text" id="fname" name="FirstName" value=""><br>

  <input type="submit" value="Submit">
</form>

</body>
</html>

No comments:

Post a Comment