Run
Online Code Editor
It is an example of using the jQuery index() method.
Click the below color names to get their index value.
Violet
Indigo
Blue
Green with id = "p1"
Yellow
When Using index().
Index :
When Using index("p").
Index :
When Using index("#p1").
Index :