How do I remove selected text from an input control?
问题 Basically, I want to be able to detect: if there is highlighted text inside of a text input How to remove the selected text I set up a fiddle to show how far I got, but I can't figure out how to remove the given text. http://jsfiddle.net/z36Px/ Here is my markup <input type='text' value='Hello World!' id='txtbox' /> <br /> <button id="btnSelect">select text</button> <button id="btnRemove">remove selected text</button> and my javascript $("#btnSelect").click(function () { document