I have two divs
one is both are containing one same class and all are in a div named “content” and may be the three div are comes random order.
<div class="error messages">Hello</div>
<div class="status messages">How</div>
<div class="error">are you</div>
So how could I get the text of “error messages” both class containing message in JS or jQuery?
I mean, I want to alert the “Hello” text, how can it be possible?
Use both classes in the selector:
http://jsfiddle.net/rPw7F/