0

Why el[0] ???? Can't we do it el.href....?

12th Dec 2016, 6:32 PM
sahag
sahag - avatar
2 Respuestas
+ 2
Hi! If you refers to the example in the JavaScript course is because the use of getElementByTagName () method, this mehod returns all of the elements of the specified tag name as an ARRAY. So, with brackets [] is the correct way to access array elements
12th Dec 2016, 6:43 PM
Andrés Ceballos Sánchez
Andrés Ceballos Sánchez - avatar
0
thanks bro !
12th Dec 2016, 7:14 PM
sahag
sahag - avatar