亚洲欧美日韩国产综合在线_国产av无码专区亚洲av桃花庵_亚洲国产欧美在线看片一国产_久久精品国产亚洲Aⅴ香蕉

jquery獲取input中的值

程序猿 2021-03-10 21:50:23 3199瀏覽 加載中

如何用javascript獲取input輸入框中的值,js/jq通過name、id、class獲取input輸入框中的value

 <input type="text" name="one" id="two" class="three">

一、javascript獲取input輸入框中的值

通過 name

var text = document.getElementById("one").value

通過 id

var text = document.getElementById("two").value

通過 class

document.getElementsByClassName("three")[0].value

二、jquery獲取input輸入框中的值

通過 name

var text = $('input[name="one"]').val();

通過 id

var text = $('#two').val();

通過 class

var text = $('.three').val();


標簽:
最后修改:2025-09-15 15:33:08

非特殊說明,本博所有文章均為博主原創。

亚洲欧美日韩国产综合在线_国产av无码专区亚洲av桃花庵_亚洲国产欧美在线看片一国产_久久精品国产亚洲Aⅴ香蕉
<button id="g80sy"></button>
  • <abbr id="g80sy"></abbr>
  • <button id="g80sy"></button>
    <rt id="g80sy"><delect id="g80sy"></delect></rt>
  • | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |