What is JQuery ?
The jQuery library contains the following features:
- HTML/DOM manipulation
- CSS manipulation
- Event handling
- Effects and animations
- AJAX
- JSON parsing
- Extensibility through plug-ins
JavaScript code requires many lines of code to accomplish some task but, jQuery can do the same thing in single line of code
Steps to create first project
- Download latest jQuery file from official site here: Download latest version of jquery
- Open Your IDE and create an html page
- Include jQuery file in your project and give the reference of it in html page.
- Try below example
# Example
Replace your html code with below code and try to show alert on button click in Jquery
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script src="jquery-3.2.1.min.js"></script> <script> $(document).ready(function () { $("button").click(function () { alert("Button was clicked") }) }) </script> </head> <body> <button>Click to show alert</button> </body> </html>
No comments:
Post a Comment