HTML
    | Change particular
  • color onclick and other
  • in the same
      to default color

前端 未结 6 1267
有刺的猬
有刺的猬 2021-01-18 22:12

I want to have 5 lists such than when any of them is clicked, it turns to green and turn the other lists to black if any of them is green.

Here\'s m

6条回答
  •  遥遥无期
    2021-01-18 22:47

    You can do this with CSS too! Like this. Behavior - On clicking it will show green, then it will turn back to black.

    li:active{
        color:green;
    }

提交回复
热议问题