如:$('#test').bind('input propertychange', function() { var cc = $(this).val().length;alert(cc);});这个是绑定事件,如不需要用$(this).val().length就行或$('#test').val().length。
$("#id").val().length;