0
我有有每个列表这样的复选框的项目清单:如何显示复选框列表信息?
<button>saveButton</button>
<ul id='testInformation'>
<li><p><input type='checkbox' /><strong>Test information <strong></p></li>
<li><p><input type='checkbox' /><strong>Test information <strong></p></li>
<li><p><input type='checkbox' /><strong>Test information <strong></p></li>
<li><p><input type='checkbox' /><strong>Test information <strong></p></li>
</ul>
现在我需要一种方法来只显示复选框的项目,这是行不通的:
$("#saveButton").click(function()
{
$("#testInformation input:checked").each(function(key,value)
{
alert(value);
});
});
输出正在说[objecthtmlInputElement]
你到底是什么期待它来显示? – 2012-02-03 02:18:40
我期待它显示文本值,测试信息 – 2012-02-03 02:19:38