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

后端 未结 7 1387
再見小時候
再見小時候 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:25

    Try

    $(bla).click(function(){        
      if (something) {
         console.log("A:"+$target.prev("input")) // gives out the right object
         $target.toggleClass("open").prev("input").attr("disabled", "disabled");
      }else{
         console.log("A:"+$target.prev("input")) // any thing from there for a single click?
         $target.toggleClass("open").prev("input").removeAttr("disabled"); //this works
      }
    });
    

提交回复
热议问题