발전하는개발자 2019. 5. 31. 10:08

<textarea class="content-box" id="content" placeholder="친구톡 내용을 입력해주세요"></textarea>

<span class="char-count">0자</span>/1000자

 

$("#content").on("keyup",function(event){

checkTextAreaMaxLength(this,event);

});

 

function checkTextAreaMaxLength(textBox, e) {

 

$(".char-count").html(textBox.value.length);

 

return true;

}

반응형