<input type=“text” id=“text” value=“1234asd” />
console.log($(“#text”).val());
输出:1234asd
console.log($(“#text”).val().length);
输出:7
<input type=“text” id=“text” value=“1234asd” />
console.log($(“#text”).val());
输出:1234asd
console.log($(“#text”).val().length);
输出:7