【发布时间】:2016-06-06 14:25:14
【问题描述】:
我想在单选单选按钮上获取 div 的内容,例如标题和其他详细信息。 我正在这样做
$('input[name=subscription_plan_radio]:checked').parent().next('plan-info').html()
通过这样做,我可以获取 plan-info div 的内容,但我想获取其中的下一个 h3。
所以,我正在尝试$('input[name=subscription_plan_radio]:checked').parent().next('plan-info h3').text()
但它给出了一个空白字符串。
下面是html代码。
<div class="plan-info">
<h3>
Pay Per Lead
</h3>
<div class="plan-details">
<h4 class="price">
$99
<span>month</span>
</h4>
<ul class="features">
<li>Buy Unsigned Leads</li>
<li>Price per Category from $100 to 500</li>
<li>Email Notification when a New Leads is available</li>
</ul>
</div>
</div>
【问题讨论】:
-
单选按钮在哪里?您指的是哪个标题?
-
这台收音机在哪里?
-
单选按钮在此 html 上方,我想获取 plan-info div 的 h3
-
做个小提琴会很有帮助的
-
更好的是,不要做小提琴。做一个sn-p。
标签: javascript jquery html css