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

    • 0
    • 0
    • 0
    • 0
    • 3
    • 0
    • 0
    • 0
    • 297
    Comment on it

    Hello Readers,

    We use add() method to add elements with a existing group of elements or selectors.

    Syntax: selector.add(selector)


    Please find the following description of all the parameters used by this add methods

    Selector It refer to a comma-separated list of selectors to select elements to be added. (e.g. add(".1class, .2class")).

    Here is the example of add() method.

    <!doctype html>
    <html lang="en">
    <meta charset="utf-8">
    <title>jQuery add method</title>
    <script src=""></script>
        <p>Hello, This is first Line!</p>
        <span>Hello Again, and this is the second line!!</span>
    $( "p" ).css("color","#c00").add("span").css( "background", "yellow" );

 3 Comment(s)

Sign In

Sign up using

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: