Changing the class of a div when clicking on it?

前端 未结 5 1515
时光说笑
时光说笑 2020-12-18 07:39

How can I change a div class name when clicking on it? Eg:

<
5条回答
  •  盖世英雄少女心
    2020-12-18 07:56

    That's because there is no code to do so. Add a little check. I also added some semicolons. I wonder if your script would even work the first time.

    
    

提交回复
热议问题