In this article I will explain with an example, how to use jQuery on() method instead of jQuery live() function or in other words replace jQuery live() function instead of jQuery on() method.
jQuery 1.9+ onwards jQuery live() function has been removed and hence an alternative i.e. jQuery on() needs to be used.
 
 
jQuery on() Syntax
Following is the syntax of writing and using jQuery on() function.
Note: Parent element can be any parent element of the control. To make it easier you can specify BODY as the parent element.
 
Using jQuery on() instead of jQuery live() - Replace jQuery live() instead of jQuery on()
 
 
Using jQuery on() instead of jQuery live()
The following HTML Markup consists of two HTML Buttons. Button1 is assigned click event handler using jQuery live() function and Button2 is assigned click event handler using jQuery on() function.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>
    <input type="button" id="Button1" value="Button 1" />
    <input type="button" id="Button2" value="Button 2" />
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    <script type="text/javascript">
        $("#Button1").live("click", function () {
            alert("Button1 clicked");
        });
        $("body").on( "click", "#Button2", function () {
            alert("Button2 clicked");
        });
    </script>
</body>
</html>
 
 
Screenshot
Using jQuery on() instead of jQuery live() - Replace jQuery live() instead of jQuery on()
 
 
Demo
 
 
Downloads