簡體   English   中英

更改下一個元素jQuery的值

[英]change value of next element jquery

我有一個input字段和span如下所示,想replace spantext

<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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM