gpt4 book ai didi

jquery - 释放字段后从文本框中获取值

转载 作者:太空宇宙 更新时间:2023-11-04 15:28:07 24 4
gpt4 key购买 nike

因为我是 jquery 的新手,我不知道我到底在做什么,

我有一个名为 frmCustom 的表单,并且有三个文本框

 <form id="frmCustom">

<input type="text" id="width">
<input type="text" id="height">
<input type="text" id="depth">

</form>

我只想在使用jquery输入后立即获取文本框内的三个值

任何帮助将不胜感激,

提前致谢

最佳答案

您可以订阅 .change 事件:

$('#frmCustom input[type="text"]').change(function () {
var width = $('#width').val();
var height = $('#height').val();
var depth = $('#depth').val();
});

关于jquery - 释放字段后从文本框中获取值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17501922/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com