开发者

jquery descendant selector issue

开发者 https://www.devze.com 2022-12-19 18:38 出处:网络
Code below select the <td> in which I\'d like to select an <a> tag. How can I get the <a> ?

Code below select the <td> in which I'd like to select an <a> tag. How can I get the <a> ?

var refresh_link = $(this).parent().next().next()

Markup: when I click TEXT LINK A I want to select TEXT LINK B

<tr>
        <!-- product id -->
        <td>6005</td>

        <!-- product name -->
        <td>            
        Bla bla text<br />
        </td>

        <!-- monthly or daily price -->
        <td>
        270.0&euro; / mois
        </td>

        <!-- quantity + hidden field with the rowid + hidden field with original price at pageload -->
        <td>    
        TEXT LINK A
        </td>

        <!-- rental duration -->
        <td>
        bla
        </td>

        <!-- refresh / update cart quantity or duration -->

        <td><a id="1" href='#'>bla</a></td>

        <!-- total price calculated -->
        <td class='price_tot'>
        TEXT LINK B
        </td&g开发者_如何学Ct;

        <!-- send to trash -->
        <td><a href='#'>trash</a></td>

    </tr>


How about this:

 var refresh_link = $(this).parent().next().next().find('a');
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号