I have following HTML
<div id="header1" class="toggle">Section 1 : Create an account</div>
<div id="section1">
First name: <input type="text" name="firstname" /><br />
Last name: <input type="text" name="lastname" />
</div>
I want to disable all input elements which are in a div which is next to div with class="toggle".
In above exmple div with id="header1" have class="toggle",I want to disable all inputelements which are in div next to it i.e. input elements within div with id="section1".
I tried $('.toggle').next(div input)).attr("disabled", true); but no luck. I am not sure if we can use nested selector in next().
Use next and then find:
http://jsfiddle.net/b8n2k/1/
Or using an expanded version of 3nigmas answer:
http://jsfiddle.net/b8n2k/