简体   繁体   中英

jQuery TextBox type over text?

I am looking for code/plug-in/whatever that will make a textbox behave similar to what happens when you press the Insert button in a text editor and anything you type is typed over existing text. I am new to web dev, please be little specific. Thanks.

A lightweight way to do this is the labelOver plugin , you can see a demo here .

Your markup looks something like this:

<div class="label"> 
  <label for="applied">Applied</label> 
  <input type="text" id="applied" /> 
</div> 

Then the jQuery:

$('label').labelOver('over');

You adjust the CSS for your needs, look at the demo page for an example. For source, look here , very lightweight. Another big plus that some alternative plugin's don't do: it also degrades gracefully with JavaScript disabled, and since clicking a label for an input focuses it in any browser, it's using the built-in behavior as a fall-back.

There are alternatives certainly, but after trying several, this is the one I settled on: for size, ability to customize styling easily, etc.

Maybe this Jeditable ? and here you have the demo .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM