jQuery wrap text without container
I've got this html
<div>This text is <strong>really</strong> awesome!</div>
I want to wrap inside <span> clicked part of text. So if you click on This
text is part you should get
<div><span>This text is </span><strong>really</strong> awesome!</div>
And same with any atomic part of the div
I'm trying to make $('div').click(); event but I cant find out how to
detect only clicked part if it not wrapped inside something (its ok with
<strong>really</strong> part but not with part before and after it)
No comments:
Post a Comment