多个HTML元素可以同时获得焦点吗? [英] Can multiple HTML elements receive focus at the same time?

查看:646
本文介绍了多个HTML元素可以同时获得焦点吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个编写JavaScript报告组件的代码,需要多个LI的列表作为一个整体被视为反馈的集合。

I'm a coding a JavaScript reporting component, that requires multiple LI's i.e. lists to be selected collectively as a bunch with visual feedback.

调整 onfocus 事件。是否有可能多个HTML元素同时获得焦点?

I'm thinking of adapting the onfocus event. Is it possible for multiple HTML elements to receive focus at the same time?

不是输入,而是DIV,所以我不需要光标。我只是想让几个DIV与别人分开选择,用不同的颜色来模拟多个项目的选择。

Not inputs, but DIVs, so I don't need the cursor. I just want several DIVs to be "selected" separately from others, colored differently to simulate multiple item selection.

推荐答案

一次只能在一个元素上焦点

No, you can only focus on one element at a time.

这篇关于多个HTML元素可以同时获得焦点吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆