There are some formatted
text inside the textarea
and a cursor is in some place. I need to check if the cursor is between some specific tags.
Example:
foo|
bar.
isBetween(['b', 'strong']); // should return true in above case
I have function
that returns position
of the cursor
inside textarea
(is has some IE
issues, but satisfies me for now). So, all I need is that isBetween()
function
.
Thanks for any help!
Update:
<p>qwer<b>ty|ui</b>op</p>
isBetween(['p']); // should also return true, because the cursor in not only between 'b', it is between 'p' too
You should enclose the space between the tags with a
span
tag. Then, in jQuery, use the.mouseover()
function.Example:
The span has to have something in it, so throw an
in there as a space.Live fiddle example: http://jsfiddle.net/PrruT/
UPDATE:
I'm not going to do the whole function for you, but I'll tell you that you could set it up like this: