JavaScript - How To Get Selected LI index From UL List In JS [with source code]

preview_player
Показать описание
JavaScript Get Selected LI Index

In This Javascript Tutorial we will See How To Get The Selected li Item From An Unordered List ul And Display The Index Value On LI Click Using Array In JS And Netbeans Editor

More Javascript Tutorials :

get maximum value from html table

get minimum value from html table

get sum value

get avg value of table column

How to get value of selected radio button

How to append Value to an array

javascript images slider 1

Convert String To Number

JavaScript Show And Hide Input Password Text

change div class name in js

using checkbox with js

get And Set Value To An Input

Search Element In Array

Add Search Remove Array Element

Add HTML Table Row

Get Mouse Position

Populate UL with LI from array:

Insert A New LI To UL List:

Get And Display Selected LI From UL:

delete selected li:

edit selected LI:

reverse all ul's li items:

add edit remove selected li from ul:

Using Range Input:

Move HTML Table Selected Row Up And Down:

Add Remove Toggle Class:

Transfer Rows Between Two HTML Table:

------------ COURSES YOU MAY LIKE ------------

Рекомендации по теме
Комментарии
Автор

Thanks a lot of you sir... for fix my problem... take love from (Earth)

spsujoypaul
Автор

but there is a problem in it ... try to give all the LI items the same name like : php ... when ever you click it will show you the index is 0

mrdeveloper
Автор

How to convert this index value in php?

amusementdiaries
Автор

this is great but how do you use the ` :nth-child()` ?

itsupport
Автор

Nice solution but, what can i do if two or more items has the same html content?

JorgedelCampoAndrade