Contents
jQuery live and die: Main Tips
- The jQuery
.live()
function attached one or more event handlers to selected elements. - To remove these handlers,
.die()
method was used. - Both of these methods were removed in 1.9 version of jQuery. Use .on() and .off() instead.

- Simplistic design (no unnecessary information)
- High-quality courses (even the free ones)
- Variety of features
- Nanodegree programs
- Suitable for enterprises
- Paid certificates of completion

- Professional service
- Flexible timetables
- A variety of features to choose from
- Professional certificates of completion
- University-level courses
- Multiple Online degree programs

- Great user experience
- Offers quality content
- Very transparent with their pricing
- Free certificates of completion
- Focused on data science skills
- Flexible learning timetable
Adding Handlers with .live()
The jQuery .live()
method was used to add one or more event handlers to the selected elements.
It had the following syntax:
$("selector").live(event, data, function);
jQuery .live()
method accepted three arguments:
- The type of
event
. - Additional
data
to pass with the function (optional). - The
function
that was executed when the specified event occured.
Note: the jQuery .live() function was deprecated in version 1.7 of jQuery and removed in 1.9. Use .on() instead.
Using .die() to Remove Handlers
The jQuery .die()
removed event handlers added with the .live()
function.
$("div").die();
We introduce the syntax of .die()
function:
$("selector").die(event, function);
It took two parameters:
event
specified a standard JavaScript event or a customjQuery.event
object.function
named a specific handler function to remove (if skipped, all attached handlers were removed).
Note: the jQuery .die() method was deprecated in 1.7 version and removed in 1.9 version. Use .off() instead.
Latest Udacity Coupon Found:
75% OFF COURSES
Udacity Black Friday Offer
The best time to save on Udacity courses is now - follow this coupon to access a 75% Udacity Black Friday discount & enjoy learning at a very low cost!