JQuery中html、append、appendTo、after、insertAfter、before、insertBefore、empty、remove的使用

  1. html method to add elements or empty html code html code (parameter empty string);
  2. append Add html code to the end of the element;
  3. This method is much like appendTo with append method, except that the target html code you want to add something different;
  4. html code after adding back to the element, if the element after the element, it will be moved back after the element, and then insert the html code;
  5. before added to the front element html code, if there are elements of the front element, and that the forward front of the element, and then insert the html code;
  6. The encapsulated insertAfter JQuery element inserted after the specified element, if the element after the element, it will be moved back after the element, and then JQuery object is inserted;
  7. The encapsulated insertBefore JQuery element inserted in front of the specified element, the element if the element in front, it will move forward in front of the element, then the object is inserted JQuery;
  8. empty empty elements inside html code, it's just empty inside html code, but the tags are still left in the DOM;
  9. remove to remove the entire element from the DOM.

Guess you like

Origin www.cnblogs.com/mark5/p/11491774.html