Get the Highlighted/Selected text
Is it possible to get the highlighted text in a paragraph of a website e.g. by using jQuery?
Is it possible to get the highlighted text in a paragraph of a website e.g. by using jQuery?
You can separate multiple classes with the space: http://api.jquery.com/addClass/
$.browser was deprecated in version 1.3 and removed in 1.9 You can verify this by viewing the documentation.
You can use this which refers to the current input element. http://jsfiddle.net/4gZAT/ Note that you are comparing the value against allot in both if statements and :radio selector is deprecated. In case that you are not using jQuery, you can use the document.querySelectorAll and HTMLElement.addEventListener methods:
This is how you should do it : ( for google find) Better solution : ( Salman’s) http://jsbin.com/yakubixi/4/edit
If your element exposes class A from the start, you can write: This will remove class A and add class B. If you do that again, it will remove class B and reinstate class A. If you want to match the elements that expose either class, you can use a multiple class selector and write:
Editor’s note: user agent detection is not a recommended technique for modern web apps. See the comments below this answer for confirmation of this fact. It is suggested to use one of the other answers using feature detection and/or media queries. Instead of using jQuery you can use simple JavaScript to detect it: Or you … Read more
I’m using the “Angularised” version of the Spin control, as documented here: http://blog.xvitcoder.com/adding-a-weel-progress-indicator-to-your-angularjs-application/ One of the things I don’t like about the shown solution is the use of jQuery in the service that effectively attaches the spin control to the DOM element. I would prefer to use angular constructs to access the element. I’d also … Read more
No jQuery required at all!