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中,它顯示.is(":visible") = false
,即使它是true
。jQuery`.is(「:visible」)`不適用於Chrome
我使用jQuery的以下版本:jQuery的1.4.3.min.js
的jsfiddle鏈接:http://jsfiddle.net/WJU2r/4/
你能發表你的html代碼嗎? – xdazz
最好在jsfiddle鏈接?並可能檢查與jquery.latest。 – xaxxon
makaspan可能顯示:無,或可見性:隱藏? –