When developers find themselves repeating a task, they tend to look for a way to simplify their workflow. We saw earlier how CSS frameworks were developed to ensure consistency across applications and to expedite developer workflows. Tools with similar goals have emerged in the JavaScript ecosystem.
jQuery is a JavaScript library that simplifies DOM manipulation and event handling. It allows us to write fewer lines of code than we'd need to if we were using plain ol' JavaScript to accomplish the same end. jQuery also provides a number of methods for animations and working with APIs.
Some argue that jQuery is slowly being phased out and replaced with front-end frameworks such as React. You might not see as many job listings for jQuery developers, but it’s an important skill to master as the library is still widely used in both new and legacy code.
The following topics will be covered in this unit:
- jQuery
- DOM traversal and manipulation
- Event handling
- this
- data-* attributes
You will be employer-ready if you can answer the following questions:
- What is jQuery?
- What is the difference between a library and a framework?
- Why is dynamically generated HTML an issue for developers working with jQuery?
You will be employer-competitive if you are able to:
- Explain the difference between a JavaScript library and a framework
- Incorporate jQuery into HTML documents via CDN and using its associated selector
- Perform DOM traversals to get and select elements by tag, class, and id as well as node relationship
- Perform DOM manipulations to add, remove, and modify elements and attributes
- Implement interactivity using event handlers
- Explain the importance of
document.ready()
and how to resolve issues related to dynamically generated HTML
Create a simple calendar application that allows the user to save events for each hour of the day. This app will run in the browser and feature dynamically updated HTML and CSS powered by jQuery.
© 2019 Trilogy Education Services, a 2U, Inc. brand. All Rights Reserved.