if ($("#makespan").is(":visible") == true) {
var make = $("#make").val();
}
else {
var make = $("#othermake").val();
}
Make:<span id=makespan><select id=make></select><span id=othermakebutton class=txtbutton>Other?</span></span><span id=othermakespan style="display: none;"><input type=text name=othermake id=othermake> - <span id=othermakecancel class=txtbutton>Cancel</span></span>
上述代码在Firefox中运行流畅,但在Chrome中似乎不起作用.在Chrome中,即使是true
也会显示.is(":visible") = false
.
我正在使用以下jQuery版本:jQuery-1.4.3.min.js
jsFiddle-Link:http://jsfiddle.net/WJU2r/4/