Get Element in HTML Ordered List by Index Using Javascript
问题 I looked quite a bit for a solution for this but I surprisingly couldn't find anything. Maybe I just didn't search for the right words. I found a bunch of questions about getting the index by the element, but I need the opposite. I'm trying to use javascript and jquery get an element in an ordered list by it's index in the list. For example, if I have this list: <ol> <li>Zero</li> <li>One</li> <li>Two</li> <li>Three</li> </ol> I would like to be able to get the first one ( Zero ) by its index