I managed to get it to work by adding the span
on hover and then removing it on mouseleave
.
I stored the span
and the text node as a variable then using the append()
I appended it to the p
tag. When the user moved off I used remove()
to remove the variable on mouseleave
.
To see it working click the fiddle. http://jsfiddle.net/Yokocapolo/g7AyV/7/
Thanks again to those who answered my question.