字数限制

js:

$("#area").on("input propertychange", function () {

var $this =$(this),

        _val = $this.val(),

        count ="";

    if (_val.length >600) {

$this.val(_val.substring(0, 600));

    }

count =600 - $this.val().length;

    $("#text-count").text(count);

});

html: