public class DomHelper extends Object
Constructor and Description |
---|
DomHelper() |
Modifier and Type | Method and Description |
---|---|
static Element |
append(Element elem,
String html)
Creates new DOM element(s) and appends them to el.
|
static Element |
insertAfter(Element elem,
String html)
Creates new DOM element(s) and inserts them after el.
|
static Element |
insertBefore(Element elem,
String html)
Creates new DOM element(s) and inserts them before el.
|
static Element |
insertFirst(Element elem,
String html)
Creates new DOM element(s) and inserts them as the first child of el.
|
static Element |
insertHtml(String where,
Element el,
String html)
Inserts an HTML fragment into the DOM.
|
static Element |
overwrite(Element elem,
String html)
Creates new DOM element(s) and overwrites the contents of el with them.
|
public static Element append(Element elem, String html)
elem
- the context elementhtml
- raw HTML fragmentpublic static Element insertAfter(Element elem, String html)
elem
- the context elementhtml
- raw HTML fragmentpublic static Element insertBefore(Element elem, String html)
elem
- the context elementhtml
- raw HTML fragmentpublic static Element insertFirst(Element elem, String html)
elem
- the context elementhtml
- raw HTML fragmentpublic static Element insertHtml(String where, Element el, String html)
where
- where to insert the html in relation to el - beforeBegin,
afterBegin, beforeEnd, afterEnd.el
- the context elementhtml
- the HTML fragmentCopyright © 2015. All rights reserved.