Skip to content

tiger986/inputWordNumber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

How many characters can also be entered

HTML code

<div class="uploadWorks_con_e">
    <div class="uploadWorks_con_title">Message description</div>
    <div class="uploadWorks_con_e_text">
        <textarea class="uploadWorks_con_e_text_con" placeholder="Tell your bewilderment"></textarea>
        <p>80</p>
    </div>
</div>

JS code

$(function(){		
    var value = "";
    var length = 0;
    $(".uploadWorks_con_e_text_con").keyup(function(){
        if(length <= 0){
            value = $(".uploadWorks_con_e_text_con").val().substring(0, 80);
            $(".uploadWorks_con_e_text_con").val(value);
        }
        length = 80 - $(".uploadWorks_con_e_text_con").val().length;
        $(".uploadWorks_con_e_text").find("p").html(length);			
    });
})

About

How many characters can also be entered

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages