Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要从输入文本元素 id="add-tag" 插入一些文本以使用 jQuery 输入文本元素 id="show-tag"
<form> <input name="add-tag" type="text" id="add-tag" /> <button>Send</button> <hr /> <input name="show-tag" type="text" id="show-tag" /> </form>
尝试这个.val()
.val()
$(function () { $('#show-tag').val($('#add-tag').val()); });
演示