Ita*_*vka 6 html javascript events input
我需要在已禁用的输入标记上有onclick/hover事件.
还有另一种方法,但将其包装在另一个标签中,并为该标签提供事件吗?
<input type="checkbox" onclick="cant_choose('event')" disabled="disabled" value="2" name="enroll_to[event][]">
Run Code Online (Sandbox Code Playgroud)
您可以使用JavaScript和CSS 模拟它被禁用.
也就是说,模糊它收到的所有焦点,并添加类似的东西.
input.disabled {
background: #d4d0c8;
color: #888;
cursor: default;
}
Run Code Online (Sandbox Code Playgroud)
与JSbin上的普通和浏览器禁用输入框相比较,可以看到它.