i want to change the background color after clicking?

后端 未结 5 1338
礼貌的吻别
礼貌的吻别 2021-01-21 18:18

I want to change the background color after clicking

This is my HTML code

...
5条回答
  •  自闭症患者
    2021-01-21 18:46

    http://jsfiddle.net/ThiefMaster/3ZmCh/16/

    You need to pass this as an argument and use proper JavaScript in the handler method:

    function getclick(elem) {
        elem.style.backgroundColor = '#EFF2F7';
    }
    

提交回复
热议问题