Home » Tutorials » JavaScript » jQuery Introduction

jQuery Introduction

jQuery works by using functions, a library, written in JavaScript. You can use these functions to write powerful things without actually typing much code. jQuery is very lightweight and efficient so you don’t have to worry about it slowing down the user experience.

Referencing jQuery is extremely easy and there are multiple ways to do it. Remember that you can reference JavaScript from anywhere. You could even take the JavaScript that I am writing for this website and use it. The first way uses this principle. Google has a jQuery library available for all developers to use.

Example <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"
</script>

If you have a trust issue with Google, you can always download their library and reference it like you would any other JavaScript file. Download the JQuery Library

The Syntax Difference

The basic syntax of jQuery is written much like how you would reference an object’s method. In JavaScript, we would do this by document.write, where document is the object and write is the method. jQuery is similar, but we are using selectors instead of objects, and including a $ at the beginning.

Example $(selector).action();

The selector here is whatever we are referencing. It can be an HTML elements id, name, class, etc. You will have a better understanding of what I am talking about in the Selectors tutorial.



Link/cite this page

If you use any of the content on this page in your own work, please use the code below to cite this page as the source of the content.

  • Stewart, Suzy. "jQuery Introduction". After Hours Programming. Accessed on March 16, 2024. https://www.afterhoursprogramming.com/tutorial/javascript/jquery-introduction/.

  • Stewart, Suzy. "jQuery Introduction". After Hours Programming, https://www.afterhoursprogramming.com/tutorial/javascript/jquery-introduction/. Accessed 16 March, 2024.

  • Stewart, Suzy. jQuery Introduction. After Hours Programming. Retrieved from https://www.afterhoursprogramming.com/tutorial/javascript/jquery-introduction/.



0 thoughts on “jQuery Introduction”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.