public static interface Html5.Element<This extends T4,T4> extends Html4.Element<T4>
This interface contains convenience method to set common attributes or non-standard attributes.
Most methods return `this` for method chaining.
Default Methods | |
---|---|
This |
attr(String name,
CharSequence value)
Set the attribute value.
|
This |
attr(String name,
boolean value)
Set a boolean attribute.
|
This |
attr(String name,
int value)
Set an integer attribute.
|
This |
on(String event,
CharSequence script)
Set an event attribute.
|
This |
data(String name,
Object value)
Set a data attribute.
|
This |
class_add(CharSequence clazz)
Add a new class to the "class" attribute.
|
This |
accesskey(CharSequence value)
Set attribute
accesskey="{value}" . |
This |
class_(CharSequence value)
Set attribute
class="{value}" . |
This |
contenteditable(boolean value)
Set attribute
contenteditable="true/false" . |
This |
contextmenu(CharSequence value)
Set attribute
contextmenu="{value}" . |
This |
dir(CharSequence value)
Set attribute
dir="{value}" . |
This |
draggable(boolean value)
Set attribute
draggable="true/false" . |
This |
dropzone(CharSequence value)
Set attribute
dropzone="{value}" . |
This |
hidden(boolean value)
Set boolean attribute
hidden . |
This |
id(CharSequence value)
Set attribute
id="{value}" . |
This |
inert(boolean value)
Set boolean attribute
inert . |
This |
itemid(CharSequence value)
Set attribute
itemid="{value}" . |
This |
itemprop(CharSequence value)
Set attribute
itemprop="{value}" . |
This |
itemref(CharSequence value)
Set attribute
itemref="{value}" . |
This |
itemscope(boolean value)
Set boolean attribute
itemscope . |
This |
itemtype(CharSequence value)
Set attribute
itemtype="{value}" . |
This |
lang(CharSequence value)
Set attribute
lang="{value}" . |
This |
spellcheck(boolean value)
Set attribute
spellcheck="true/false" . |
This |
style(CharSequence value)
Set attribute
style="{value}" . |
This |
tabindex(int value)
Set attribute
tabindex="{value}" . |
This |
title(CharSequence value)
Set attribute
title="{value}" . |
This |
translate(boolean value)
Set attribute
translate="yes/no" . |
attr, getAttribute, setAttribute
default This attr(String name, CharSequence value)
Html4.Element
setAttribute(name)
.attr
in interface Html4.Element<T4>
default This attr(String name, boolean value)
Html4.Element
attr
in interface Html4.Element<T4>
default This attr(String name, int value)
Html4.Element
attr
in interface Html4.Element<T4>
default This on(String event, CharSequence script)
Html4.Element
For example,
_a().on("click", "alert('boo')"); // <a onclick="alert('boo')">
on
in interface Html4.Element<T4>
default This data(String name, Object value)
For example,
_div().data("taste", "chicken"); // <div data-taste="chicken">
default This class_add(CharSequence clazz)
Html4.Element
For example
DIV div = _div(); // <div> div.class_add("c1"); // <div class="c1"> div.class_add("c2"); // <div class="c1 c2">
If `clazz` is null or empty, this method has no effect.
class_add
in interface Html4.Element<T4>
default This accesskey(CharSequence value)
accesskey="{value}"
.default This class_(CharSequence value)
class="{value}"
.class_
in interface Html4.Element<T4>
default This contenteditable(boolean value)
contenteditable="true/false"
.default This contextmenu(CharSequence value)
contextmenu="{value}"
.default This dir(CharSequence value)
dir="{value}"
.dir
in interface Html4.Element<T4>
default This draggable(boolean value)
draggable="true/false"
.default This dropzone(CharSequence value)
dropzone="{value}"
.default This hidden(boolean value)
hidden
.default This id(CharSequence value)
id="{value}"
.id
in interface Html4.Element<T4>
default This inert(boolean value)
inert
.default This itemid(CharSequence value)
itemid="{value}"
.default This itemprop(CharSequence value)
itemprop="{value}"
.default This itemref(CharSequence value)
itemref="{value}"
.default This itemscope(boolean value)
itemscope
.default This itemtype(CharSequence value)
itemtype="{value}"
.default This lang(CharSequence value)
lang="{value}"
.lang
in interface Html4.Element<T4>
default This spellcheck(boolean value)
spellcheck="true/false"
.default This style(CharSequence value)
style="{value}"
.style
in interface Html4.Element<T4>
default This tabindex(int value)
tabindex="{value}"
.default This title(CharSequence value)
title="{value}"
.title
in interface Html4.Element<T4>
default This translate(boolean value)
translate="yes/no"
.