Search This Blog

Friday, September 10, 2010

Select Element Array and Then Give it Method

Programmer Question

i have 6 element and i want to select the 5th element (with jQuery)



$(".deskripsi")[2]


then give it a method, but when i try it it give me error in console log



$(".deskripsi")[2].innerHTML is not a function


can somebody tell my how to select element array in jQuery and give it method.



oke, may it's seems my question is still unclear. my point is to select that element (array number 5), innerHTML is just only for to see in my console log if i select the right target.



please let me give another example.
let say i have 6 list like this




  • A

  • B

  • C

  • D

  • E

  • F




now i want to select the li number 5
(i use innerHTML only for check the li value)



Thanks



Find the answer here

No comments:

Post a Comment

Related Posts with Thumbnails