if ($("#IndicationCalculatorGroupId option:selected").text() == 'Create a New Group')
{
$("#newGroupNameRow").show();
}
$("#IndicationCalculatorGroupId").change(function() {
if ($("#IndicationCalculatorGroupId option:selected").text() == 'Create a New Group')
{
$("#newGroupNameRow").show();
}
else{
$("#IndicationCalculatorNewGroupName").val('');
$("#newGroupNameRow").hide();
}
});
我在文档中准备好了。基本上当页面加载时,我想检查一下是否有一个特定的值,如果它确实显示特定的div。 onChange()事件正常工作,所以我知道检查正确完成,它似乎不工作onDocumentReady。 div不会显示()。JQuery没有在Document Ready上执行
我做错了什么?
似乎没有css工作http://jsfiddle.net/DkZpB/1/ – Rafay 2011-02-25 19:34:12
雅,我只是说,如果他想隐藏初始状态,它需要通过CSS或'.hide()完成。 ',而不是内联样式。 – ggutenberg 2011-02-25 19:37:31