Change Button color onClick

前端 未结 4 430
渐次进展
渐次进展 2020-11-29 04:59

I want my Button to change color every time I click on it. But it only changes color on the first click.

I believe the problem is in the setColor

4条回答
  •  天命终不由人
    2020-11-29 05:19

    Using jquery, try this. if your button id is say id= clickme

    $("clickme").on('çlick', function(){

    $(this).css('background-color', 'grey'); .......

提交回复
热议问题