Simple Javascript library used to create elements.
Create a simple element without attributes
el.create('div')
=> <div></div>
Create an element with content inside and a class
el.create('a', {'class':'content', 'href':'http://markgandolfo.com', 'content':'Mark Gandolfo'})
=> <a class="content" href="http://markgandolfo.com">Mark Gandolfo</a>
You could even use selectors in the initial name to quick create with id's and classes
el.create('div#myId.content')
=> <div id="myId" class="content"></div>
el.create('div.row')
=> <div class="row"></div>
el.create('div.row', {'id':'myId', 'content':'Some content in your div'})
=> <div id="myId" class="row">Some content in your div</div>
Create a child and parent element
img = el.create('img', {'src':'http://placekitten.com/200/300'})
el.create('a', {'href':'http://markgandolfo.com', 'content':img})
=> <a href="http://markgandolfo.com"><img src="http://placekitten.com/200/300" /></a>
Create data-attributes (or any other attributes)
el.create('div', {'data-action':'submit', 'id':'myId'})
=> <div data-action="submit" id="myId"></div>
These can be used standalone, or you could pass attributes in as an argument
el.c() - This is an alias of el.create()
el.div()
el.p()
el.input()
el.img({'src':'http://placekitten.com/200/300'})
el.a({'src':'http://placekitten.com/200/300'})
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request