DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR JAVASCRIPT
js get element by index
var
arr
=
[
"item"
,
"item2"
]
;
arr
.
indexOf
(
"item"
)
;
// return 0
arr
.
indexOf
(
"item2"
)
//retrun 1
PREVIOUS
NEXT
Tagged:
#js
#element
#index
ADD COMMENT
Topic
COMMENT
Name
3+6 =
Submit