siblings

jQuery Controlling Single DIVs With the Same Class (Siblings?)

I am building a FAQ module for my site and I want to be able to control single elements on the page even though they all have the same class. I believe this comes under siblings which I am not yet familiar with. Basically I want the user to be able to click the question div and then when they click it the answer div within the same div ...

Can't select SPAN sibling

Can't understand why this code changes color of DIV element to blue, but doesn't change color of a SPAN element. Any ideas? <html> <head> <script src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt; <script> $(document).ready(function(){ $("#prev ~ div").css("color", "blue"); $("#prev ~ span").css("color"...

Is there a way to select sibling nodes?

For some performance reasons, I am trying to find a way to select only sibling nodes of the selected node. For example, <div id="outer"> <div id="inner1"> </div> <div id="inner2"> </div> <div id="inner3"> </div> <div id="inner4"> </div> </div> If I selected inner1 node, is there a way for me to access its sib...

[jQuery] How do i get the value of all other dropdowns when one of them is changed.

Hello Everyone, I am trying to populate a text box based on the values from a set of dropdowns. Once the user changes the value of a dropdown, I would like to get the values of all other dropdowns that are contained within the same div. In the example below, I am trying to display the value all 'selects' in a gien div through a dialo...

jquery next siblings

Hi stackoverflow! (first post!) Ive been trying to get this problem solved, but I cant seem to figure it out without some serious workarounds. if I have the following html code: <ul> <li class="parent"> headertext </li> <li> text </li> <li> text </li> <li> text </li> <li class="parent"> headertext </li> <li> text </li> <li> text </li>...

Checkbox changes the parent tr, and the inputs contained within...

Hi guys, Not sure of the best way to explain this... I have an input where you can enter two times, but also a checkbox if you wish to omit a certain day, thus rendering the inputs kinda useless, so I'd like to disable them... Here's what I have at the moment for the HTML (repeated 7 times): <td><div>From:</div><input type="text" name...

how to hide all right siblings with jQuery?

$(this).parent().next().css('display','none'); The above only hides the sibling right next to the current one. If there are multiple ones,will fail. ...

Replacing fields with jQuery

Why is line 10 returning null? http://pastie.org/720484 it works with line 40 ...

JQuery - grab the td value next to radio button

Hello, I have the following dilemma: My HTML is as such (this exists within a PL/SQL app.): <table id="search_result_table"> <tr> <input type=radio name="pv_select" value="'||lv_spriden_id||'"/> <font face="Calibri" size=3><td id="spriden_id" name="spriden_id">'||lv_spriden_id||'</td></font>' <font face="Calibri" size=3><td id="la...

Select first sibling.

I'm trying to select the inner value of the first sibling - using jQuery - in an environment where I cannot alter the html markup. I have the following: <tr> <td>3</td> <td>bob</td> <td>smith</td> <td>[email protected]</td> <td> <img src="bobsmith.png" onclick="doSomething()" /> </td> </tr> I'm trying to...

Find if node has siblings using simplexml

I am try to find if a certain node has siblings, and if it does, I would like to know what those siblings are. Is this possible? ...

jquery access sibling TD in table

I have the following HTML Code. What I'm try to do is to have the div named javaRatingDiv to be displayed once the checkbox with the name java is checked. I can't seem to figure out how to navigate to the next TD in a table via jquery. <div id="languages"> <table style="width:inherit"> <tr style="height:50px; vertical-align:to...

nextSibling issues...

Ok, this has been killing me all night, I mean I've been working on this code for atleast 8 hours now. What is the problem with this, argggg. I am trying to update all <span id="column_[row index number]_[column index number]_[layout position number]"> to increment it by one up until the next id="row_[row index number]" tr element, The...

nextSibling issue, should be simple

Ok, I'm trying to come to grips with this nextSibling function in JS. Here's my issue within the following code... var fromRow = document.getElementById("row_1"); while(fromRow.nodeType == 1 && fromRow.nextSibling != null) { var fRowId = fromRow.id; if (!fRowId) continue; // THIS ONLY gets done once and alerts "row_1" ONL...

Blackberry multiple MyApp-#.cod files when signing

Hi, When I want to debug on device or just to sign my application when loading it on my device, I have weeks after weeks a growing number or COD files to sign... I'm now at 72! It means my RIM signatures quota, even if it is huge, it's going down very fast and I receive 72 emails every time I sign it. I need to come back to the start, w...

casting between sibling classes, AS3

I have two classes, derivedClassA and derivedClassB which both extend parentClass I'm declaring var o:parentClass and then, depending on what's going on, I want to cast o as either being of type derivedClassA or derivedClassB. Essentially, this: var o:parentClass ... if(shouldUseA) o = new derivedClassA(); else o ...

xPath: select following-sibling and self nodes

Hello, From this piece of HTML: <tbody> <tr> <tr id="1" class="first"> <tr id="2" class=""> <tr id="3" class="last"> <tr id="4" class="first"> <tr id="5" class=""> <tr id="6" class="last"> <tbody> I´m trying to get an xPath expression to return all tr[@class='first'] nodes followed by tr which don´t have a...

jQuery siblings and $(this) blur and focus

I have a form with labels and input fields. When clicking into a field I want to style the field with CSS and display some information about the input requirements in a div under the label. The focus() and blur() events add the classes for styling the field just fine but trying to show/ hide the info divs triggers the methods on ALL fie...

jquery. how to get each siblings height?

Hello! I think this is very easy question for someone who is more experienced in Jquery. for example we have simple html page with a few divs, and 3 of them have the same css class 'sidebar' Each of this 'sidebar' divs have different content and different height. I need to compare this divs height and find the longest one. I know h...

ActiveRecord siblings in many-to-many relationship

I have this working to a degree, but I am looking for some input on how to query for the siblings in a one to many relationship to see if there is a more elegant way of accomplishing this. Consider the following classes class Post < ActiveRecord::Base has_many :post_categories has_many :categories, :through => :post_categories en...