1

This seems like a pretty simple question but I honestly couldn't find an answer. I have 3 forms on my side that open up when a button is pressed and I want to autofocus a cursor on whichever one of the forms opens up. Because the forms are identical, I'm having trouble referencing any individual one, and it's on Squarespace so I can't just add an id. I would be really grateful for any help on this. Thanks!

Dan
  • 2,647
  • 2
  • 27
  • 37

1 Answers1

2

You could use the .eq() method. Just supply an index (they are zero based).

Given a jQuery object that represents a set of DOM elements, the .eq() method constructs a new jQuery object from one element within that set. The supplied index identifies the position of this element in the set.

Josh Crozier
  • 233,099
  • 56
  • 391
  • 304