selectors

jQuery Selectors

Hi, I am trying to take this from view source, i.e.: <a href="javascript:validateCB();"><img src="wwv_flow_file_mgr.get_file?p_security_group_id=1343380920146312332&p_flow_id=222&p_fname=submit_btn.gif" alt="Submit Details" border="0" /> into jQuery selector format var $templateButtons = $('img[src^="wwv_flow_file_mgr"]').parent('...

Select Nth previous sibling in jQuery?

I'm trying to set up my jQuery selector but I'm not exactly sure how I need to write it. I've got a unordered list that looks something like this: <ul> <li>something</li> <li>something</li> <li>something</li> <li>something</li> <li class="last">something</li> </ul> Now I know if I want to select the last child I c...

HTML: remove a:hover for images?

For text links, I have: CSS: a:link {color: #3366a9; text-decoration: none} a:hover {border-bottom: 1px solid; color: black} But this also adds a black underline on linkable IMGs that I do not want. How do I remove the border-bottom on linkable IMGs when hovered using CSS? I've tried the following: a:hover img {border-bottom: 0px...

Why doesn't a:hover work on an anchor without an href attribute?

In my application, I can't get the a:hover css style to work when my anchor tag doesn't have an href attribute. Is there any reason for this? ...

Jquery multiple class selector

Hi guys, I want to select all the elements that have these two classes 'a' and 'b'. So, only the elements that have both classes. When I use $(".a, .b") it gives me union, but I want intersection. ...

Can't figure out the jQuery selector

So Basically I am trying to keep the top level categories image of a down arrow turned on while hovering over the submenu's elements. I want to do this through jQuery on a hover function however I cannot for the life of me get a selector to target the sub menu items. Here is the code I am trying to run: $(document).ready(function() { ...

jQuery selector for every row except the first on every table except first

I want to apply right alignment on the last cell of every table row, skipping the first table on the page and skipping the first row of every table. I wrote the following: $("table:gt(0) tr:gt(0) td:last-child").css("text-align", "right"); The tables after the first are selected. GOOD. The last cell in each row is aligned right. GOOD...

jQuery selector AND operator...

This may sound like a simple question, but I just cannot seem to find an answer on google, probably because the search term will bring back quite a lot of irrelevance. I would like a jQuery selector to select all odd table rows, that are not in <thead> and apply a css class to them all. "table.cp-ss-grid tr:odd" The above selector wil...

Does duplicate id's screw up jquery selectors?

If I had two divs, both with id="myDiv" Would $("#myDiv").fadeOut(); fade both divs out? Or would it fade only the first/second? Or none at all? How do I change which one it fades out? Note: I know duplicate id's is against standards but I'm using the fancybox modal popup and it duplicates specified content on your page for the conte...

jQuery filter through IDs and then capture matches

Hi, I find myself doing this repeatedy. $jq("button").filter(function(){ return this.id.match(/^user_(\d+)_edit$/); }).click(function(){ var matches = this.id.match(/^user_(\d+)_edit$/); var user_id = matches[1]; alert('click on user edit button with ID ' + user_id); }); So I want to apply a click event to some butto...

Using jQuery how do I select a range of rows?

Does a jQuery only solution exist for selecting a range of rows from a table? I know 'eq', 'lt', 'gt' exist, but I'm looking for a combination of those selectors. ...

jQuery - how to select a hidden field by value?

I have the following HTML generated by an ASP.NET repeater: <table> <tr> <td><input type="hidden" name="ItemId" id="ItemId" value="3" /></td> <td>Terry</td> <td>Deleted</td> <td>Low</td> <td>Jun 21</td> </tr> .... ...

[jQuery] Execute script based on which option is selected in a select box?

I've got a select box where the user selects which elements they want to see based on option 1, option 2 and option 3. So what I'm trying to set up is have if option 1 is selected run one set of commands and if option 2 run another and so on. I guess I just need to know how to set up the jQuery selector. ...

Jquery multiple selectors, select items which match both criteria

if i do this... $('.class1, .class2').hide(); Then all items with class1 or with class2 will be hidden. <pre class='class1'>hello1</pre> <pre class='class2'>hello2</pre> <pre class='class1 class2'>hello3</pre> What is the syntax so only the 3rd <pre> will be hidden, I want to hide things based if they have both class1 and class2. ...

jQuery Ajax - Get Elements Inner Text

I have a PHP file which will return something like <div id="title">Add Us On Myspace!</div><img id="image" src="http://i39.tinypic.com/67jybs.png" alt="Add Us On Myspace!" /> This is called using this... $.ajax({ url: "Tabnews.php", success: function(tab1html){ $("#tabs-1").html(tab1html); } }); I need to de...

jQuery [attribute] selector only returning first element, not all

Hello, I'm trying to apply styling to all elements with a title attribute. For some reason this code is only returning the first, not all. I'm probably missing something obvious... Any help would be great, thanks! $("[title]").each(function() { doSomething(this); } ...

jQuery: Find All Unselected Checkboxes, How To

In jQuery, how does one go about finding all the 'unchecked' checked boxes. $(':checkbox:checked'); appears to be me all checked boxes, but what I need is all non-checked boxes. ...

jquery parent select - more efficent way

Is there are more efficient way than the following for selecting the third parent? $(draggable).parent().parent().parent().attr('entityid') ...

Java - Multiple selectors in multiple threads for nonblocking sockets

Hi there, I'm writing a Java application that will instantiate objects of a class to represent clients that have connected and registered with an external system on the other side of my application. Each client object has two nested classes within it, representing front-end and back-end. the front-end class will continuously receive da...

jQuery select elements on 1st "level"

I want to select only the elements on the first "level". Ex: <div id="BaseElement"> <p>My paragraph 0</p> <div> <span>My Span 0</span> <span>My Span 1</span> </div> <span>MySpan 2</span> <span>MySpan 3</span> <p>My paragraph 1</p> </div> Let's say that you got the BaseElement node. var Element = $("div#BaseElemen...