切换到包含 div 的 (id="center") 后,无法在 textarea 中输入内容?
这是代码...
<div id="north">North</div>
<div id="west">West</div>
<div id="center"><textarea></textarea></div>
脚本
$(document).ready(function() {
var divs = ["north", "west", "center"];
var startIndex = 0;
$(document).keydown(function(e) {
if (e.which == 9) {
$("div").css("border", "");
$("#" + divs[startIndex]).css("border", "4px solid gray");
startIndex++;
if (startIndex === divs.length) {
startIndex = 0;
}
}
return false;
});
});