I have some “tags” enlosed in double brakets within a text area like:
Hello {{name}}, welcome to {{place}}
I’m trying to figure out how to make it so that if I click anywhere within the double brackets of a tag that I can get it to expand the selection to include all of the text within the bracket and then be able to use that selection within JQuery.
In other words, if I just click anywhere within the tag {{name}} it will get me the full tag text “name” without needing to select the whole thing.
What would be the best way to go about this?
I have prepared following fiddle, which selects your ‘tag’ when clicked inside.
http://jsfiddle.net/zD8tc/