Welcome message using jQuery


In this article I am going to explain to create simple program which display "Welcome" message box using jQuery.

Welcome message using jQuery



In this article I am going to explain to create simple program which display "Welcome"
message box using jQuery. This application will use the javascript alert method to display the "Welcome" message.



When use click the "Click me" button, the alert message is displayed to the user.

The following method is used to attached the click event to the button.




$("#BtnClickMe").click(function(){....}


Full code



<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Welcome message using jQuery</title>
<script type="text/javascript" src="jquery-1.2.6.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#BtnClickMe").click(function(){
alert("Welcome!");
});
});
</script>
</head>

<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="BtnClickMe" runat="server" Text="Click Me" />
</div>
</form>
</body>
</html>


Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: