Start using JQuery in Web Application


In this article we will see how we can use jQuery compatible script in a simple web application. jQuery is a buzzword today for writing script behind in mark up.

Create A Simple Web Application

Create a new web application and name it as JQuerySample.

Downloading jQuery from the below link and the necessary/minimum files to include to run jQueries.

The followings are the minimum files required to run jQuery.




We will add the above files into one folder and name it as jQuery.

Add the script reference to the Web Application’s header as follows:

src=”jQuery/jquery-1.3.2.min.js” type=”text/javascript”></script>

We will add a normal jQuery so that we can test the application.

Write any jQuery and run your application.

type=”text/javascript” language=”javascript”>

$(function() {

$(‘#btnSubmit’).click(function(event) {

var txtMyInput = $(‘#txtInput’)

if (txtMyInput.val() == “”) {

alert(“Please Enter your name.”);


else {

alert(“Your name is: “+ txtMyInput.val());





If you look into the above jQuery you would find out that we have added one TextBox and one Button. If you look into the jQuery more deeply you would understand that we are checking the value of the Text input and validating it.

That’s it you have successfully used jQuery in your application.

Keep scripting. J