Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do i in jQuery get td span value when clicking to increase RadNumericTextBox using spin buttons
    text
    copied!<p>I have TABLE and within it i have several CELLS - PRICE, QUANTITY, TOTAL When the RadNumericTextbox spin buttons are clicked id like to increase the TOTAL cell.</p> <p>I have the following</p> <pre><code> &lt;tr&gt; &lt;td&gt;&lt;a href="#" title="View Product Details"&gt;&lt;asp:Label ID="LblTitleTableView" runat="server" Text=""&gt;&lt;/asp:Label&gt;&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;asp:Label ID="LblWeightTableView" runat="server" Text=""&gt;&lt;/asp:Label&gt;&lt;/td&gt; &lt;td&gt; &lt;asp:Label CssClass="TabPrice" ID="LblProdPriceTV" runat="server" Text=""&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;td&gt; &lt;telerik:RadNumericTextBox ID="txtQuantity" CssClass="ProdDropDowns" RegisterWithScriptManager="true" Value="1" MinValue="1" runat="server" Width="50px" Type="Number" ShowSpinButtons="true" &gt; &lt;NumberFormat DecimalDigits="0" /&gt; &lt;ClientEvents OnValueChanged="TabularProductQtyChanged"&gt;&lt;/ClientEvents&gt; &lt;/telerik:RadNumericTextBox&gt; &lt;/td&gt; &lt;td&gt;&lt;asp:Label ID="LblTotalTableView" runat="server" Text=""&gt;&lt;/asp:Label&gt;&lt;/td&gt; &lt;td&gt; &lt;a href="javascript:void(0)"&gt; &lt;asp:Image ID="AddBasketImgTableView" runat="server" ImageUrl="~/clients/14/themes/moredetails.png" AlternateText="Click for More Information" /&gt; &lt;/a&gt; &lt;/td&gt; &lt;/tr&gt; </code></pre> <p>and the jQuery</p> <pre><code> function TabularProductQtyChanged(sender, args) { var qty = args._initialValue; } </code></pre> <p>I can get the quantity but am unable to traverse back up the DOM tree to get to the price which is inside the Label - LblProdPriceTV</p> <p>Any ideas on how i can do this?</p> <p>EDIT:</p> <p>With the help from below ive been digging around in FireBug and realised the RadNumericTextBox control injects extra html markup. therefore i need to go further back up the DOM tree to get to the element i want - this in the end works:</p> <pre><code> alert($('#' + elementID).parent().parent().parent().parent().parent().parent().parent().parent().find('.ThisIsPrice').find('span').html()); </code></pre> <p>Thank you for everyones help below.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload