• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 34. DOM-2 Range > Boundary Points for Text Nodes

Boundary Points for Text Nodes

With ranges, it is especially important to grab the correct node as the container before working with the offset.

Imagine you want to select the characters "ne" in the text inside the second HTMLParagraphElement. We'll call this p. If you choose the p element itself as the container for a boundary node, you could use an offset into the child nodes of the p element.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint