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>
Run Code Online (Sandbox Code Playgroud)
上面的代码在Firefox中运行顺畅,但在Chrome中似乎不起作用.在Chrome中它.is(":visible") = false甚至可以显示true.
我正在使用以下jQuery版本:jquery-1.4.3.min.js
jsFiddle链接:http://jsfiddle.net/WJU2r/4/