javascript - I am a little confused, why can I directly use checked=true to add effects to tags in js?
阿神
阿神 2017-06-26 10:55:27
0
2
762

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" ?

阿神
阿神

闭关修行中......

reply all(2)
迷茫

Add css attributes after style. checked is an attribute of input, so there is no need to add style.

阿神

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template