KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm trying to find the next element with a class of "error" and hitting a wall. In looking at the demo on jQuery's site, this should work, but doesn't. $("button[disabled]").next().text("this button is disabled"); <div> <button disabled="disabled">First</button> <span>no overwrite</span> <span class="error"></span> </div> <div> <button>Second</button> <span></span> </div> <div> <button disabled="disabled">Third</button> <span>no overwrite</span> <span class="error"></span> </div> I'm trying to find the span or div or whatever after the element in question, like the button above. so the disabled button line should read, 'no overwrite this button is diabled' I've tried $("button[disabled]").next(".error").text("this button is disabled"); to no avail.
Tags (comma-separated)
Save Edits
Cancel