Matej Posted December 2, 2014 Share Posted December 2, 2014 Hello , im trying to create a range inside an element. Here = http://jsfiddle.net/9kpm9upk/2/ i tried it with setStart and setEnd but i realized it takes element i cant use it on content of element(in this case innerHTML), is thre any way to create range on innerHTML of certain element?(im not talking about selecting it manualy ) Thanks for asnwers Link to comment Share on other sites More sharing options...
justsomeguy Posted December 2, 2014 Share Posted December 2, 2014 The contents of a node are still a node, but innerHTML is not a node, it is a string. You can use node.childNodes[0] to get the first child node of a parent node. Link to comment Share on other sites More sharing options...
Matej Posted December 2, 2014 Author Share Posted December 2, 2014 got it, thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now