naive dom utils.
npm install relax-domLightweight DOM manipulation library.
typescript
import $, {Dom} from 'relax-dom';
let $input : Dom;
$input = $('input');
`API
function ( selector: string|HTMLElement ) : Dom
If the type of selector parameter is string, the function will query by document.querySelectorAll.
function( htmlOrTag:string ) : Dom
Create a Dom object from html or tagName.
If the parameter includes < character, it will be considered as html string.
Otherwise, the parameter is considered as a tag name.
``javascript
$.create('
`
function( html:string ) : DocumentFragment
Usage scenarios:
`javascript
//
$('#container').append( $.create('outerinner') ); //
`
`javascript`
$.create('txt1text2').outerHtml(); //txt1
$.create('text1text2').outerHtml(); //text1text2
$.create('div').append($.fragment('txt1text2')).outerHtml(); //txt1text2
In create` method,text must be wrapped.