我正在做一些關於JQuery的自學,並且遇到了一個問題:
我試圖使用JQuery next()API來獲取數據從隱藏類型的文本框字段,但我沒有這樣做。
這裏是我的代碼:使用JQUery Next()API從隱藏的文本框中獲取數據
$(document).ready(function(){
$(".Testing").click(function(){
var what = $(this).next().val();
alert(what);
});
});
<span class="Testing">Hello</span><br/>
<input type="hidden" value="World">
<span class="Testing">Hi</span><br/>
<input type="hidden" value="There">
你能幫我解決這個問題嗎?