input disable을 자바스크립트로

input disable을 자바스크립트로

QA

input disable을 자바스크립트로

답변 2

본문

id="rr" 인 div의 input이 있습니다.

 

rr 의 css가 display:none 일 때 rr 안의 input을 disable 해주는 걸 자바스크립트로 짜주실 분 안계신가요 ㅠㅠ

 

css만 알고 프로그램은 아예 몰라서 ㅠㅠ

 

 

이 질문에 댓글 쓰기 :

답변 2


if( $('#rr').css('display')=='none' ) {
  $('#rr input').each(function () {
    $(this).attr('disable',true');
  });
}

<script>

$(function(){ 
  if($("#rr").css("display") == "none")
  {
      $("#rr").attr("disabled","disabled");
  }
});

</script> 

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 0
© SIRSOFT
현재 페이지 제일 처음으로