newElement

.newElement(tagName, [attributes, htmlContent, events, css])

tagNamean html tag without the brackets, like "div", "span", "input", "form",...

attributesjsonObject contains attributes for the element

htmlContenthtmlString for the content of the element

eventsjsonObject with events to associate to the element

cssjsonObject with the css attributes of the element

create a new HTMLElement with the specifieds parameters

var el = newElement("div", { id: id, class: "cl1" }, "i'm here", { click: clickOnMe, mouseover: mouseOverMe },{border:solid 1px gray,color:'white'}");

qs

qs(selectors)

selectors

Return the first element that match selectors

<div class="c1">1</div> <div class="c1">2</div> <script> var el = qs(".c1"); console.log(el.text()); //1 </script>

qsi

qsi(htmlid)

htmlid

Return the first element that match selectors with #id=htmlid

<div id="id1" class="c1">1</div> <div id="id2" class="c1">2</div> <script> var el = qsi("id2"); console.log(el.text()); //1 </script>

qsa

qsa(selectors)

selectors

returns all elements within the document that matches the specified selector, or group of selectors. If no matches are found, null is returned.

<div id="d1" class="cl"> <span class="aze">Hello</span> <span class="aze">World</span> </div> <script> var el = qsa("[class:'aze']"); console.log(el.text()); // Hello World </script>

qsn

qsn(intputName)

intputName

returns the first Element within the document that have the specified name. If no matches are found, null is returned.

<div id="d1" class="cl"> <input type="text" id="id1" name="t1" value="1" /> <input type="text" id="id2" name="t2" value="2" /> <input type="text" id="id3" name="t3" value="3" /> </div> <script> var el = qsn("t2"); console.log(el.val()); // 2 </script>

qsnames

.qsnames(selectors)

selectors

returns all Elements within the document that matches the specified name. If no matches are found, null is returned.

<div id="d1" class="cl"> <input type="text" id="id1" name="t" value="1" /> <input type="text" id="id2" name="t" value="2" /> <input type="text" id="id3" name="t" value="3" /> </div> <script> var el = qsnames("t"); console.log(el.text); // 123 </script>