<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
本文标题:Jquery val方法获取对象value和length属性
本文链接:https://www.haomeiwen.com/subject/wgasyxtx.html
网友评论