Winnetou Selectors
As we said earlier, WinnetouJs loves vanillaJs, but we know how manipulating the DOM can give us a headache. That is why Winnetou brings with it the "select" method to help make DOM manipulations easier.
All child methods of select are documented with jsdoc, so the VSCode auto complete will work very well.
The basic syntax is Winnetou.select(selector).method([arguments])
select.js
Winnetou.select(myDiv.ids.div)
.html("changed")
.css("backgroundColor", "#eee")
.toggleClass("blue");
Winnetou.select(myDiv2.ids.div).hide();
Winnetou.select(myDiv3.ids.div).hide();
Winnetou.select(hiddenDiv_.ids.hiddenDiv).show();
Child Methods List
- html(htmlContentString) - sets inner HTML of constructo
- remove() - removes a constructo from the DOM
- getHtml() - get innerHtml from constructo
- getText() - get only text inside a constructo
- append(htmlContentString) - appends html
- prepend(htmlContentString) - prepends html
- css(property, value) - change css of a constructo. List of properties.
- toggleClass(className) - toggles class
- addClass(className) - adds class
- removeClass(className) - removes class
- hide() - hides a constructo
- show() - shows a constructo
- getWidth() - get width of a constructo
- getHeight() - get height of a constructo
- getLeft() - get left of a constructo
- getTop() - get top of a constructo
- getGlobalPosition() - get getGlobalPosition
- getVal() - get value
- setVal(newValue) - sets value
- setAttr(attr, value) - sets attr
- getAttr(attr) - get attr value
- isChecked() - return true if is checked
- getFile() - get file info
- enable() - turn button clickable
- disable() - turn button disabled