.attr(“disabled”, “disabled”) issue

后端 未结 7 1381
再見小時候
再見小時候 2020-12-28 17:05

I have this function toggles the disabled attribute form a input field:

$(\'.someElement\').click(function(){     
  if (someCondition) {
     console.log($         


        
相关标签:
7条回答
  • 2020-12-28 17:44

    UPDATED

    DEMO: http://jsbin.com/uneti3/3

    your code is wrong, it should be something like this:

     $(bla).click(function() { 
            var disable =  $target.toggleClass('open').hasClass('open');
           $target.prev().prop("disabled", disable);
      });
    

    you are using the toggleClass function in wrong way

    • http://api.jquery.com/toggleClass/
    0 讨论(0)
提交回复
热议问题