[javascript] How do I get first element rather than using [0] in jQuery?