我有這樣的小提琴,當我按下選項卡上,重點應下一個元素集,但它不是.. 下面的代碼..jQuery的警報重置重點不同的元素?
<input type="text" style="font-size:12px;width:245px;" border-style="Solid" tabindex="3" id="txtCAddress" maxlength="100" name="txtCAddress" />
</br>
<input type="text" style="font-size:12px;width:245px;" border-style="Solid" tabindex="4" id="txtMobile" name="txtMobile"/>
</br>
<input type="text" style="font-size:12px;width:245px;" border-style="Solid" id="txtPriority" maxlength="300" name="txtPriority" tabindex="5" autocomplete="off" />
JS的是
$(document).ready(function(event) {
$('#txtCAddress').keydown(function(e) {
if ((e.which == 9)) {
if ($('#txtCAddress').val() == '') {
alert('me');
}
}
});
});
當我按txtCAddress
中的標籤並附上一些文字,但沒關係,關注的是txtMobile
的設置除外,但是當我按下txtCAddress
中的標籤時沒有任何文字時,警報即將到來,但是關注點已經設置在txtPriority
?
爲什麼重點不在txtMobile
?
編輯 JS的小提琴
對於我來說,這不是發生在小提琴上 - txtMobile在關閉警報後獲得焦點。我只在IE9中測試過。 –
@AlanShortis。與鉻一樣。 – gdoron
@gdoron。與Firefox相同。加工。 – Rac