Skip to content
Advertisement

Tag: jquery

jQuery hover and class selector

I wan’t to change the background color of a div dynamicly using the following HTML, CSS and javascript. HTML: CSS: Javascript: EDIT: I forgot to say that I had reasons not to want to use the css way. And I indeed forgot to check if the DOM was loaded. Answer Your code looks fine to me. Make sure the DOM

jQuery $(document).ready and UpdatePanels?

I’m using jQuery to wire up some mouseover effects on elements that are inside an UpdatePanel. The events are bound in $(document).ready . For example: Of course, this works fine the first time the page is loaded, but when the UpdatePanel does a partial page update, it’s not run and the mouseover effects don’t work any more inside the UpdatePanel.

jQuery get specific option tag text

All right, say I have this: What would the selector look like if I wanted to get “Option B” when I have the value ‘2’? Please note that this is not asking how to get the selected text value, but just any one of them, whether selected or not, depending on the value attribute. I tried: But it is not

How to change the href attribute for a hyperlink using jQuery

How can you change the href attribute (link target) for a hyperlink using jQuery? Answer Using will modify the href of all hyperlinks to point to Google. You probably want a somewhat more refined selector though. For instance, if you have a mix of link source (hyperlink) and link target (a.k.a. “anchor”) anchor tags: …Then you probably don’t want to

Highlight a word with jQuery

I basically need to highlight a particular word in a block of text. For example, pretend I wanted to highlight the word “dolor” in this text: How do I convert the above to something like this: Is this possible with jQuery? Edit: As Sebastian pointed out, this is quite possible without jQuery – but I was hoping there might be

How to show a spinner while loading an image via JavaScript

I’m currently working on a web application which has a page which displays a single chart (a .png image). On another part of this page there are a set of links which, when clicked, the entire page reloads and looks exactly the same as before except for the chart in the middle of the page. What I want to do

Advertisement