Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Member Reza O's Avatar
    Join Date
    Nov 2012
    Posts
    53
    Member #
    33634
    Liked
    1 times
    I looked it up and it says: Add elements to the set of matched elements.

    Then it gives an example:

    <ul>

    <li>list item 1</li>

    <li>list item 2</li>

    <li>list item 3</li>

    </ul>

    <p>a paragraph</p>


    $('li').add('p').css('background-color', 'red');

    doesn't that mean make the background color red for all li and p?

    Thanks in advance for your reply.

  2.  

  3. #2
    Member Reza O's Avatar
    Join Date
    Nov 2012
    Posts
    53
    Member #
    33634
    Liked
    1 times
    By the way if I put the script at the end of <body> it works. If it's in the head it won't work... anyone know why?


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 01:30 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com