Home › Forums › JavaScript › need javascript help [1] › Reply To: need javascript help [1]
November 19, 2013 at 7:16 pm
#156614
Alen
Participant
getElementsByClassName
returns an array of elements.
Since our two boxes are different, we have to select them individually. If we had many box1
then you would have to use for loop to style them. Since we know we only have one item in the array, using [0]
selects the element we want.