How to change css property using jquery with this code

后端 未结 3 758
天涯浪人
天涯浪人 2021-02-14 19:21

\"#business\" is currently set to background: #323232; How can I change it to #000; after I click on \"#business\" and back to 323232 once the menu is closed?

$         


        
3条回答
  •  被撕碎了的回忆
    2021-02-14 19:49

    The css function is used for changing CSS properties like background.

    $('html').click(function() {
      $('#businessmenu').hide("");
      $('#busniessmenu').css('background-color', '#323232');
    });
    
    $('#business').click(function(event){
      event.stopPropagation();
      $(this).css('background-color', '#000');
    });
    

提交回复
热议问题