[英]change value of next element jquery
我有一個input
字段和span
如下所示,想replace
span
的text
。
<div>
<input autofocus="autofocus" type="email" value="" name="buyer_signup_email" id="buyer_signup_email" autocomplete="off">
//want to change below elements text
<span class="help-block red-text">will change this text</span>
</div>
我嘗試了這個但是沒用
$('input[name="buyer_signup_email"]').next().val('dd')
有人可以告訴我這里有什么問題嗎? 謝謝。
嘗試使用.text()
而不是.val()
$('input[name="buyer_signup_email"]').next().text('dd')
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.