如何使用jquery获取具有类EventAddress的单元格的值?
<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元素的内容,那么您可以执行以下操作:
$(".EventAddress").text();