在桌面浏览器(Chrome)中,我可以使用 jQuery 函数将输入字段设置为禁用:
inputVar.prop('disabled',true)
. 在 GS3 手机上的 Android 浏览器中,同样的代码似乎没有任何作用。我已经在 Android Chrome 和默认浏览器上进行了测试。
有什么选择吗?我也试过这些,但没有运气。
inputVar.attr('disabled','');
inputVar.attr('disabled','disabled');
inputVar[0].disabled = false;
编辑 完整代码
$("fieldset#myFieldSet > input").each(function(){
var inputVar = $(this);// This is the jquery object of the input
inputVar.prop('disabled',true);
});