• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jquery, difference between "DOM Insertion, Inside" and "DOM Insertion, outside"?

 
Chrix Wu
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am reading the jquery API now, but i am comfused about these two:

  • "DOM Insertion, Inside" These methods allow us to insert new content inside an existing element.
  • "DOM Insertion, outside" These methods allow us to insert new content outside an existing element.


  • can anyone explain it to me please? what is existing element refer to? give me an example will be great


    these are the links:
    http://api.jquery.com/category/manipulation/dom-insertion-outside/
    http://api.jquery.com/category/manipulation/dom-insertion-inside/
     
    Bear Bibeault
    Author and ninkuma
    Marshal
    Pie
    Posts: 64717
    86
    IntelliJ IDE Java jQuery Mac Mac OS X
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Easy enough.

    "Inside" means just that. The new element becomes a child of the existing element.

    "Outside" means that the new element does not become a child of the existing element, but rather a sibling.



     
    Chrix Wu
    Ranch Hand
    Posts: 121
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Bear Bibeault wrote:Easy enough.

    "Inside" means just that. The new element becomes a child of the existing element.

    "Outside" means that the new element does not become a child of the existing element, but rather a sibling.





    Hi Bear,

    i am currently reading your 《jQuery in Action》, I didn't expect meet you here

    anyway, thanks very much!!
     
    Bear Bibeault
    Author and ninkuma
    Marshal
    Pie
    Posts: 64717
    86
    IntelliJ IDE Java jQuery Mac Mac OS X
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Surprise!
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic