I have the code below:
var redNow = 1; function highlight(cell) { redNow == 1 ? redNow = 0 : redNow.style.borderColor = "black"; redNow = cell; cell.style.borderColor = "red"; } td { cursor: pointer; } Cell 1 Cell 2 Cell 3 Cell 4 Cell 5 Cell 6 Cell 7 Cell 8 Cell 9 0 讨论(0) 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复
var redNow = 1; function highlight(cell) { redNow == 1 ? redNow = 0 : redNow.style.borderColor = "black"; redNow = cell; cell.style.borderColor = "red"; }
td { cursor: pointer; }
Cell 1 Cell 2 Cell 3 Cell 4 Cell 5 Cell 6 Cell 7 Cell 8 Cell 9