jquery-selectors

jQuery Appending Attribute to Elements That Contain The Specified Text Node

For example, I would like to append selected="selected" to the option that contains This one, which jQuery selector should be used to append attributes into that element? <select> <option>Not this</option> <option>This one</option> </select> Thanks in advance! ...

jquery is(":visible") and is(":animated") bug during animation?

Here's the thing. I have multiple icons, which each show a message in a div. when i hover over the icon, the box shows, when i mouse out, it closes. when i click, i want that the box will not close automatic, but only after i click the X in the corner of this box. this all worked good, until I added animation. the problem is that the...

save jquery selector result into array

I'm trying to save a jquery selector's result into an array so I can reference each element later. I tried this... var found_slides = []; //create the array to hold selector results found_slides = $(".slide"); //run the selector and store results var current_slide = found_slides.length - 1; //find the last slide found_slides[current...

What are the differences between these ways of selecting element in jQuery?

Hello If I have the following markup <div id="previewNote" class="note yellow" style="left:25;top:25px;z-index:1;"> <div class="body"></div> <div class="author"></div> <span class="data"></span> </div> I can select the "previewNote" DIV either by using $("#previewNote") or $("[ID$=previewNote]") and with even other ...

Is it possible to append to a div with a given attribute?

Hey guys quick question, How do you append to a specific div with a specified attribute? ex. <div attribute="234"></div> $('#divwithattribute234').append('test'); ...

jQuery, Select by attribute value, adding new attribute

Hi, I have an anchor in my HTML. it has a page attribute with a value. So everytime it is clicked I use the page attribute value in my js. Now I want to set a style attribute with a background color to show that a certain a element is selected. So I have to select the element by page attribute and add a new attribute with a value to the...

jQuery Prev() Question

Sorry guys, I should have posted the script directly without cleaning it. Please check the updated script, it should now clear things up. Thanks! Consider the following JavaScript : var selected = 0; var options = 0; $('.newListSelected').each(function() { selected = $(this).children('.selectedTxt'); selec...

Jquery Detecting a Pause

Hi guys, I'm using jQuery and the cycle plugin to simply rotate some images. On a mouse even I ask it to pause, $('.content-main-imgholder', this).cycle('pause'); My question is how can now detect if the cycle is paused? i.e. if( cycle = pause ) { //do something } Thanks in advance for your help. ...

Why does my Javascript function only work SOME times?

My sandbox is here: http://9.latest.truxmap.appspot.com/ First click a marker on the map (if there are none when the page loads, check the 'food trucks opening soon' box in the navigation widget). Next go to the 'Reviews' tab. In GWT, everytime I open a marker I'm calling the javascript function resizeReviewTab() which corrects styli...

jQuery, get and set tag values

Hi, I have a <span id="test">5</span> and I wand to get its value, 5. And I want to change that value. how do I realize that. ...

jQuery, Select nested element

Hi, I select $("a.tp[programm='" + programm + "']"); then I want to select its nested element span.thump and set the text of it. How do i realize that? <h4><a programm="74" class="tp" href="#"><img src="/images/tuo.png"></a><a href=""> <img width="180" height="40" src="/images/kauf_default.png"><br>test <span class="thump">1</spa...

Reference anchor inside a td on click of this

Hello again, here is what i have: <td class="player"><a class="link" data-display="0" data-id="1" data-workdir="4">Image.jpg</a></td> Ok, and here is my jQuery: $(".player").click(function(){ alert($(this + " a.link").attr("data-display")); // Código para llamar al reproductor indicado $.post( "php/player.php", { display : $(...

jQuery Cannot set "selected"="selected" via attr() on <option> elements?

<select> <option>1</option> <option>2</option> <option class="test">3</option> </select> $('.test').attr('selected', 'selected');​ The select box above would choose the third option as default without any issues. However, if you check the elements with Firebug there isn't any selected="selected" attribute present within th...

Hilight table data when CheckBox is checked and unhilight when unchecked

I have the following check box list inside table. I want to hilight the <td> when a checkbox is checked and unhilight when checkbox is unchecked. I know that I need to add class to <td> when checkbox is checked and remove class when unchecked. <table id="cbDepartment"> <tbody><tr> <td><input type="checkbox" name="cbDepartme...

JQuery how to select next id with selector

The html: <div id="videos"> <a href="javascript:loadAndPlayVideo('QXoIMTjk9Xg')"><img src="http://i.ytimg.com/vi/QXoIMTjk9Xg/default.jpg" id="thumb_QXoIMTjk9Xg"></a> <a href="javascript:loadAndPlayVideo('nWubfMkDfVs')"><img src="http://i.ytimg.com/vi/nWubfMkDfVs/default.jpg" id="thumb_nWubfMkDfVs"></a> <a href="javascript:lo...

Jquery Finding first Row

how to find first row of a table using jquery? ...

JQuery, how to apply the same mouseover effect to multiple divs with the same classes? help please!

i am new to jQuery and i am having some rollover issues, i am trying to apply the same "roll over" effect to multiple divs, and it seems to work, the only thing is when i roll over an element all of my divs get the same effect, when i would like them to apply the effect one at a time on mouse over, here is my code $('div.pitem').bind(...

jQuery table navigation using relative selectors only

Given a table such as the following: <tbody> <%foreach (var book in Model.Books) { %> <tr> <td> <%: book.Title %> </td> <td> <%= book.AuthorsToLinks("MyBooks/List") %> </td> <td> <%: book.Genre.GenreNam...

jQuery's Stylish-Select plugin doesn't work on elements created after page load

I've been striving to use Stylish Select Box with elements created after page load without success. In order to understand the issue, you'll need to re-produce it first. I know the following might seem a bit annoying but please continue reading if if you have 5 minutes of spare time. Alternatively, you may obtain a completed example her...

delete html, jQuery

Hi, have a look at this example link text It creates a dialog with a iframe init that loads an external page. The dialog is added to the DOM. Is it possible to delete it on dialog close event? ...