Skip to content

zjuwwq/html2dom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

html2dom

Covert html string to DOM node, support node which must be used in special context(thead, param, ...).

Case

	var node = html2dom('<td><span>123</span></td>');
	node.tagName; 	// 'td'
	node.innerHTML; // '<span>123</span>'

	var nodes = html2dom('<div>1</div><p>2</p>');
	nodes.length; 	// 2
	nodes[1].tagName; // 'p'

Test

Using karma as test runner, jasmine for test case.

Prepare for test:

npm install

To test:

npm test

About

Covert html string to DOM node

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors