2012-10-28 52 views

回答

5

你拼錯強元素的文本值單詞類型。

<input class="inputCheckbox" type="checkbox"><strong>Testing</strong> 

你可以試試,

$(".inputCheckbox input:checked").parent().find("strong").text(); 
1

的問題是,strong元素不是input元素內,但在它旁邊。這裏有幾個選項。最簡單的方法是給strong元素一個類名或id。另一種選擇是使用未定義建議的兄弟姐妹。

相關問題