使用 jquery 获取元素值 [英] get element value using jquery

查看:25
本文介绍了使用 jquery 获取元素值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 jquery 获取类 EventAddress 的单元格的值?

How do I get the value of the cell with class EventAddress using jquery?

<table cellpadding="10" class ="EventDetail">
    <tr>
        <td class="TableFields">Who Should Enroll?:</td>
        <td>Everyone 18 and older who would like to attend</td>
    </tr>
    <tr>
        <td class="TableFields">Location:</td>
        <td class="EventAddress">1300 Albany Street,Beech Grove ,IN</td>
    </tr>
</table>

推荐答案

如果你用value"表示 td-element 的内容,那么你可以这样做:

If you with "value" mean the content of the td-element, then you could do:

$(".EventAddress").text();

这篇关于使用 jquery 获取元素值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆