jquery select()
Hi I want to check whether the value of textbox is selected or not using jquery.
I want like if textbox value is alread开发者_运维百科y selected then wants to deselect the text otherwise select.
Please give me solution for this.
It appears the the $("input").select(); is able to detect if text is selected.
I'm not exactly sure what you want to accomplish, but you may want to view http://api.jquery.com/select/ for a basic demo of the functionality. Feel free to provide more details on how you want to implement this, and I'll be happy to try and build onto the demo.
I think this might be up the the browser to handle - not sure if every browser handles text selection in inputs the same way.
You could however check for focus and blur events, are you familiar with these?
There's a plugin which will detect whether it is selected: http://plugins.jquery.com/project/selectedText. As selecting text, I'm not sure.
精彩评论