does that thing even have two colors? or is it just one on a static background
Gersho
@Gersho
it did levels of gray, like a gameboy iirc
but maybe only black and white
korzo
@korzo
@moT01 It has only levels of grey. It was revolution anyway.
Nate Mallison
@NJM8
Hello, I have a basic DOM manipulation question. I am trying to find an element like and ordered list then add another list item to it using appendChild. If I search for the list using getElementByTagName, appendChild does not work, I get a type error (appendChild is not a function). However if I select the list using querySelector then appendChild works just fine. What is the difference?
Gersho
@Gersho
i did have one where the "wallpaper" was an image behind the screen, visible even when phone off
Tom
@moT01
do you have multiple of that tag?
@NJM8
korzo
@korzo
@NJM8 getElementByTagName returns collection
@NJM8 querySelector first element
Gersho
@Gersho
so getElementsByTagName[0] ?
Tom
@moT01
mdn is showing me it's getElementsByTagName
Gersho
@Gersho
plural
korzo
@korzo
yep, I was copypasting
Nate Mallison
@NJM8
I see, getElementsByTagName is an array of those elements with that tag, and querySelector is the actual elements
*element
Tom
@moT01
not sure that syntax would work but, maybe if you did it on the var or after you put the tag in @Gersho
korzo
@korzo
@moT01 As it returns collection, it works..as long as collection is not empty
Tom
@moT01
var tags = getElementsByTagName('ul');
tags[0].append...
something like that maybe?
Nate Mallison
@NJM8
that seems to work
korzo
@korzo
@moT01 you can use getElementsByTagName('ul')[0].appendChild() as long as you are sure at lest one element exists
Gersho
@Gersho
i usually put id to stuff like that, so you don't get screwed when you add stuff later
Nate Mallison
@NJM8
yup, the tutorial I'm looking at suggested using querySelector but i don't like that, too vague.
Tom
@moT01
yea, that's something to keep in mind - if you add another ul and it's before the one you're trying to target - it will mess things up
_
Nate Mallison
@NJM8
if the ul has a class can't you do something like querySeletor("ul .insertclassnamehere")
Gersho
@Gersho
don't know that works in js, try it and let us know :p
Nate Mallison
@NJM8
thats a no.
Gersho
@Gersho
thanks @NJM8
CamperBot
@camperbot
gersho sends brownie points to @njm8 :sparkles: :thumbsup: :sparkles: