jquery-selectors

Fading images in jQuery

How do I fade out all the images inside the class bMenu that are not #b2 with jQuery? Thanks. <div class="bMenu" id="b1"><img src='b1.jpg'></div> <div class="bMenu" id="b2"><img src='b2.jpg'></div> <div class="bMenu" id="b3"><img src='b3.jpg'></div> ...

What does the jQuery() function in jQuery do?

In this video there is a snippet of code that goes something like this: if (jQuery) {jQuery(function() { // ... })} I've never seen the jQuery() function before (then again, I'm not a savvy jQuery user), what does it do? Does it ship by default with jQuery or is it specific to IxEdit? Since the usual $(window).load() snippet is mi...

jQuery awkward behaviour

I am trying to load a page throughout ajax, the whole page, and formating mine as it finds in the loaded one. Something of a practical exercise. The result of the ajax call is a string containing the page's html. To make it simple, I made an example, with a string containing something of a page itself. <html> <head> <title...

Jquery: Cloning a select list and selecting an option by its value

hello, I'm trying to append a select option list to a div table with jQuery, after done this, I'd like to select a specific option of the list, I'm trying something like this: // my hidden option list <div style="display:none;"> <select class="option_list"> <option value="male">Male</option> <option value="female">Female</option...

Pull text <TD:last> based on content of the first <TD:first>

I have a table with a dozen rows, one of which is: <TR><TD> <B>Order Date</B> </TD><TD> [foo] </TD></TR> <TR><TD> and i want to assign the value of the last cell to a var. thx ...

Get DIV index value

Hi All, I am stuck with a problem here, please help. What my requirement is to get the index value of the div clicked. Have 2 lists, and i need to call a function doSomething(); only when the user clicks the first div set. Is there anyway that i can achieve it. The scripts and HTML is as follows $(document).ready(function() { $(".lis...

Getting 'href' value of an anchor inside another element

Suppose I have this: <ul id="menu"> <li><a href="someplace">some text</a><li> ... </ul> I want to make every li clickable so I need to extract the value of href like this: $('#menu li').click(function() { var link_to = $(SELECTOR THAT I NEED).attr('href'); window.location = link_to; }); what's the correct code for this? Is ...

How to get specific div text with jQuery filter()

I have the following html that renders within an ASP.NET Repeater: <div class="divDE-item" onclick="addFilter(this);"> <span class="spnKey">Some key</span> <div>1234</div> </div> I realize that having an onclick on the outer div may not be the most graceful jQuery-centric approach. However, considering my situation, it works well....

jQuery selector problem. :last-child not doing what I need

What jQuery selector would allow me to select the last <td> in a <tr> that has more than 1 <td>? NOTE: I am trying to find an answer which will allow me to use a single selector or a selector followed by a .filter() rather than using .each() <table> <tr> <td colspan="2">First Cell</td> <td>Second Cell</td> </tr> <tr> <...

Parse string for text between divs

I have a string of html text stored in a variable: var msg = '<div class="title">Alert</div><div class="message">New user just joined</div>' I would like to know how I can filter out "New user just joined" from the above variable in jQuery/Javascript so that I can set the document title to just the message. Thank you. ...

Cant find the correct selector for jquery form click

This is a very basic question. I am building a website using the google custom search api to display search results on my page. By default, google displays the search-results box on the page (without any actual results) at all times, and the list is populated when the user clicks the search button. My goal is to hide the search results b...

all children selector in jquery?

simplified, i've got following code: <a id="123" href="#"><span>click</span><span>me</span></a> when i click on 'click' and 'me' it doesnt seem to work with following jquery selector: $("a").click... maybe its because i click on the children? how could i write the selector so it maps to all children in 'a'? ...

jQuery :visible is true while executing hiding animations

I realize that this is how it's supposed to behave, but it creates a problem when I'm trying to determine the visibility of an element while it's in the process of hiding (or showing if I invert when ':animated' is true). So how can I use jQuery to determine whether an element is visible, with the caveat that elements currently visible ...

jQuery .each function across browsers (works in ff, ie8, not ie7)

I've been messing with this for far too long, and managed to get IE8 working, but IE7 has me stumped. I've got a table, and for each column, I am trying to extract a number of divs. I am only extracting divs which match specific selectors, not all divs in the column. My original jquery selector was jQuery('div.a1, div.a3, div.a4, div....

Select next rows that have ID.length > 0 in a table

Using only jQuery, how would I select the next rows in a table with an ID length > 0? In my code, I'm using a hybrid of jQuery and javascript. And it works fine. However, I'd like it to be all in jQuery. var rowsWithIds = new Array(); var rows = $(myTable).nextAll("tr"); for(var i=0; i < rows.length; i++) { if(rows[i].id.len...

jQuery selector $('table td:eq(2) a') get the cell only from the first row.

$('table td:eq(2) a') return the a tag of the third column but only from the first row. Why? ...

string concatenation inside jquery selectors

I am developing a application in C#, ASP.NET and I have a lot os divs in my page, each div is a container for a chat message and each div have a unique id: like this "<div id='" + myMsgs[j].id_chat_message + "' style='padding: 10px;'>" so, each div have the same id in page and in database. now a want to find some div, with jquery, bu...

jQuery: selecting the first instance of an element that occurs after another specified element

Using this as a simplified example, assume I have a table that has some radio buttons in it followed by a div element with a link in it. This pattern is then repeated some unknown number of times like so: <table class="rdoBtnList"> <tbody> <tr> <td> Person 1 </td> <td> <label for="rb1">Verified...

how do i enable text input in a select element? (js or jQuery)

how do i enable text input in a select element in order to both manually input a any numeric value or choose from a select having limited options? For example desktop applications such as photoshop, adjusting character size! ...

jQuery select input[type=image] siblings

I'm trying to convert these forms to ajax (an example) <table> <tr> <td>Prov</td><td>Cod</td><td>Nombre</td><td>Precio</td><td>Stock1</td><td></td><td></td> </tr> <tr class="o d"> <td class="provName">Karabitian</td> <td class="cod d">494011135</td> ...