$('#articleTitle').bind('input propertychange',function () {
            var a = $(this).val().length;
            if(a>30){
                var val = $(this).val().substr(0,30);
                $(this).val(val);
                $('#helpBlock2').html(30);
            }else{
                $('#helpBlock2').html(a);
            }
        });

  

<div class="row" >
                                                <!--第三排 13-->
                                                <div class="col-md-1 text-right">
                                                    标题:
                                                </div>
                                                <div class="col-md-6 list-inline">
                                                    <input class="form-control input-sm"   />
                                                </div>
                                                <div style="margin-top:5px;font-size: 14px;">
                                                    <span >0</span><span>/30字</span>
                                                </div>
                                            </div>

  

相关文章: