inputEx Documentation Back to homepage
inputEx.cn and inputEx.sn are two useful functions to respectively: create an html node and set node attributes.
They are used all over the place in inputEx, so its a good idea to get familiar with them:
static <HTMLElement> inputEx.cn(tag, domAttributes, styleAttributes, innerHTML)
tag <String>
- The tagName to create (ex: 'div', 'a', ...)
domAttributes <Object>
optional
- see inputEx.sn
styleAttributes <Object>
optional
- see inputEx.sn
innerHTML <String>
optional
- The html string to append into the created element
<HTMLElement>
The created node
static inputEx.sn(el, domAttributes, styleAttributes)
el <HTMLElement>
- The element to set attributes to
domAttributes <Object>
- An object containing key/value pairs to set as node attributes (ex: {id: 'myElement', className: 'myCssClass', ...})
styleAttributes <Object>
- Same thing for style attributes. Please use camelCase for style attributes (ex: backgroundColor for 'background-color')