使用jquery获取元素值 [英] get element value using jquery
本文介绍了使用jquery获取元素值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
< table cellpadding =10我怎么用classQueryAddress获取单元格的值? class =EventDetail>
< tr>
< td class =TableFields>谁应该注册?:< / td>
< td>每个想参加< / td>的18岁以上的人
< / tr>
< tr>
< td class =TableFields>位置:< / td>
< td class =EventAddress> 1300 Albany Street,Beech Grove,IN< / td>
< / tr>
< / table>
解决方案
td-element,那么你可以这样做:
$(。EventAddress)。text();
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>
解决方案
If you with "value" mean the content of the td-element, then you could do:
$(".EventAddress").text();
这篇关于使用jquery获取元素值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文