Learn jQuery: A simple ‘Hello World’ jQuery Code


jQuery – A powerful javascript library capable of doing all your complex javascript actions and functionality in a line or two. How cool is that.

Pre-requisites : Notepad, jquery.js file(You can get it here),  some coding background and an open mind

Let’s Start with a simple Hello World:

Open your notepad, create a html file as below:

<html>

<head>

<title>Hello World</title>

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

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

$.document.ready(function(){

$(“#btnX”).click(function(){

alert(‘Hello World’);

});

});

</script>

</head>

<body>

<input id=”btnX” type=”button” value=”Click Me” />

</body>

</html>

Save the above file as “HelloWorld.html” in a Folder. Copy the jquery-1.3.2.min.js  file to the same folder. Now double-click the button named “Click Me“.

Voila! An alert box pops up with “Hello World” text.

4 thoughts on “Learn jQuery: A simple ‘Hello World’ jQuery Code

  1. Right here is the right blog for anyone who would like to find out about this topic.

    You understand so much its almost hard to argue with you (not that I personally
    will need to…HaHa). You certainly put a new spin on a topic
    which has been written about for years. Great stuff, just wonderful!

  2. Hey! Would you mind if I share your blog with my zynga group?
    There’s a lot of people that I think would really
    enjoy your content. Please let me know. Thanks

Feel free to leave a reply here...

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s