Query Element
Here we will demonstrate you how easy it is to use Savvy.UI JavaScript Library to select/filter HTMLelements using SUI.Query namespace.
Selecting HTMLelements by Id
is identical with selecting using document.getElementById.
Savvy.UI is a collection of JavaScript Library which I would consider as critical or useful to any web development environment.
var node = SUI.Query.id("example-query-id"); SUI.CSS.Setup(node, { "background": "red", "color": "white", "padding": "0px 2px" });
Which we can simplify using SUI.Ext.Elements.
SUI("#example-query-id").css({ "background": "red", "color": "white", "padding": "0px 2px" });
<p id="example-query-id"> Savvy.UI is a collection of JavaScript Library which I would consider as critical or useful to any web development environment. </p>
This example requires the following namespace:
- SUI.Query
- SUI.CSS
Selecting HTMLelements by TagName
is identical with selecting using document.getElementsByTagName.
