i have several class with a name, how can getting content first class.
like:
<div class="hi">
<div class="hey"><input name="hello1"></div> // this is 1
<div class="hey"><input name="hello2"></div> // this is 2
<div class="hey"><input name="hello3"></div> // this is 3
</div>
only getting: class number 1 // <input name="hello1">
how is it with jQuery?
JSFiddle Example
Note: In jQuery, selecting by class is usually one of the slowest methods. It’s faster to select by element.className (eg
div.hey), but really, selecting by ID is the quickest (not “element#id”, just “#id”). Hope this helps