Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • jQuery after ( ) Method

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 38
    Comment on it

    This method is used to insert the data after some specified tag or content . It is just same as jQuery append( ) method. If you want to insert the data before some specified tag or content then you should use before ( ) method.
    Syntax :

     $(selector).after(content,function(index))
    

    Example :
    HTML Code :

    <html>
    <head></head>
    <body>
    <button>After click ,Data added after p tag</button>
    <p>Hello Mukesh Tomar</p>
    <p>From Meerut</p>
    </body>
    </html>
    

    jQuery Code :

    $(funtion(){
    $("button").click(function(){
    $("p").after("<p><b>I have added after p tag</b></p>");
    });
    });
    

    Output :

    Hello Mukesh Tomar.I have added after p tag

    From Meerut .I have added after p tag

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: