Reputation: 2953
I have an input
field and span
like below and want to replace
the text
in the span
.
<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>
I tried this but not working
$('input[name="buyer_signup_email"]').next().val('dd')
Could someone tell me whats wrong here? Thank you.
Upvotes: 0
Views: 1247
Reputation: 6917
try using .text()
instead of .val()
$('input[name="buyer_signup_email"]').next().text('dd')
Upvotes: 1