jQuery 버튼 텍스트 변경, 클릭시 글씨 변경
본문
<script>
$(function() {
 $('#button1').click( function() {
   if( $(this).html() == '받기' ) {
     $(this).html('확인');
   }
   else {
     $(this).html('받기');
   }
 });
});
</script> 
<button id="button1">받기</button>
<script>
$(function() {
 $('#button1').click( function() {
   if( $(this).val() == '접기' ) {
     $(this).val('펼치기');
   }
   else {
     $(this).val('접기');
   }
 });
});
</script> 
<input type="button" value="접기" id="button1">
<script>
$(function() {
 $('.sub_open').click( function() {
   $('.sub_img').toggle();
   if( $(this).html() == '열기' ) {
     $(this).html('닫기');
   }
   else {
     $(this).html('열기');
   }
 });
});
</script>
<div class="sub_open">열기</div>
 
댓글목록 0
등록된 댓글이 없습니다.
