Highlight input value jquery

Highlight input value jquery

Posted: zaq12345 Date: 11.06.2017

I'd like to know how to highlight some text within an input box ; simple example, let's say I want to highlight all the terms starting by " " while typing.

JavaScript and jQuery by Examples

The problem I'm facing is this input box, because I can't add html tags around the text and therefore can't make css on those specific terms First take a look at highlightTextarea. Made by Julien L.

.select() | jQuery API Documentation

By posting your answer, you agree to the privacy policy and terms of service. Stack Overflow Questions Developer Jobs Documentation beta Tags Users. Sign up or log in to customize your list. Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us.

jQuery change event

Log In Sign Up. Join the Stack Overflow Community.

highlight input value jquery

Stack Overflow is a community of 7. Join them; it only takes a minute: How to highlight text within an input box? Highlight input value jquery the terms are retrieved from a remote autocomplete suggestions list.

jQuery Howto: Select text in input box on user select or focus

Thanks for your help! Alternatively you could use tinyMCE, but between the binary options islam qa contentEditable and editable divs will be the easier to learn how to use. I Googled it in all possible queries, even looked how Stackoverflow did its tag selection when posting a question, but honestly, I can't figure out how to only highlight the term that has been retrieved they alls start by " ".

It's actually similar to FB functionality when you type " [username]", the value is highlighted once selected. This, I hopeis what highlight input value jquery after. Made by Julien L With this you can do the following: Works for me as a space, see my answer!

Could you look at mine? Do you see what goes wrong?

highlight input value jquery

Here is a simple example. Vins 6, 4 22 Thanks for your answer Vins, but it's not because it's selected that I can highlight it afterwards, right?

I think you misunderstood the question, 'highlight' has sort of 2 meanings. The proof is in your example. Here, the target is an input element that was clicked.

Sign up or log in StackExchange.

highlight input value jquery

Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Stack Overflow works best with JavaScript enabled. You need to look at contentEditable, making an editable area for your input, will allow you to highlight the text in the way you describe.

MathOverflow Mathematics Cross Validated stats Theoretical Computer Science Physics Chemistry Biology Computer Science Philosophy more 3. Meta Stack Exchange Stack Apps Area 51 Stack Overflow Talent.

inserted by FC2 system