String.toDOM 1.0

A simple String method to convert a string into DOM nodes



Details

Author
Yannick Croissant
Current version
1.0
GitHub
yannickcr/String.toDOM
Downloads
2122
Category
Native
Tags
Report
GitHub Issues

Releases


Dependencies

  • _self_/_current_: core:1.2.4: '*'

How to use

Example:

var code = '<p>A link to <a href="http://www.mootools.net">Mootools.net</a></p>'.toDOM(); // Return a NodeList with the DOM nodes , code[0] is the <p>
alert(code[0].getElement('a').get('href')); // alert "http://www.mootools.net"
code.inject(document.body); // Inject the nodes into the body element

Discuss

A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.

Found a bug in this plugin? Please report it this repository's Github Issues.

blog comments powered by Disqus