Reputation: 65
As far as I understand, this function is non-standard, but even for non-standard functions it was usually possible to find at least some description in the same MDN Web Docs, for example for the function document.caretRangeFromPoint()
. But for range.expand
there is nothing at all, not only in the reference book, but also on the Internet at all, and the IDE does not recognize it, it is not in the auto-completion list (the same caretRangeFromPoint is in the list, although it is crossed out and marked as deprecated). But at the same time, range.expand
definitely works at least in chrome, and I even managed to find its mentions on stackowerflow (here and here). Also, as far as I understand, this function also works or worked in the IE browser. I managed to find a small description for the version of the function for IE (textRange.expand()
) (the link was run through Google translator, so it may become outdated over time), however, not all the behavior described there works in chrome - for example, of the four argument options described there, the function accepted only two - “word” and “sentence”.
So what does it do? Is it documented anywhere?
Upvotes: 1
Views: 202