For example: I need to use js to add a selected effect to the button.
Why can you directly use op.checked = true? to add the selected effect in js? Why don't you need to add a style in the middle? If it is color, it is like this op.style.color = "red" ?
迷茫2017-06-26 10:57:27
Add css attributes after style. checked is an attribute of input, so there is no need to add style.
阿神2017-06-26 10:57:27
In fact, it’s the same if you write it directly in the html tag,
<input type="checkbox" checked/>
<span style="color:red"></span>
You write directly
<span color="red"></span>
It must be ineffective, one is the attribute of tag and the other is style