Selecting text between Brackets in an input field with Jquery

Posted by Marcel on Stack Overflow See other posts from Stack Overflow or by Marcel
Published on 2010-06-14T13:19:11Z Indexed on 2010/06/14 13:22 UTC
Read the original article Hit count: 166

Filed under:
|
|

Hi,

with $("#TextInputElement").select()

I am able to select a text (mark it) in an in an input text field.

Now I only want to select the text in between brackets in that input field. I have the regular expression match(/-[^-]*-/) to select, but how would I apply this to only select the text inside the input field between brackets?

[noselect]textToBeSelected[/noselect]

thx

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery