Get index of an elementBack
1. What is index()
This is a function which displays the position of an element on page.
After ready your document you will have to run a click function.
var li_location = $(this).index();
"var li_lication" will hold the position value of li and "$("#result span")" will show the position output.
This will be much helpful in creating tabs and sliders.
How to comment:
- Create an account in discuss by clicking on login next to arrow.
- Create password for discuss and varify your email id, through your mail.
- Refresh page and comment.
You might also like
Copy text to clipboard
Copy text from browser to your clipboard and paste as per your requirement.
Validate email field by regular expression
Select all text on single click
Text selection has been made easy