Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jun 19 2020 20:09
    @krisb1220 banned @Gastony
  • May 14 2020 22:39
    @bjorno43 banned @minitechtips_twitter
  • May 14 2020 22:38
    @bjorno43 banned @real-action
  • Feb 01 2020 00:27
    @bjorno43 banned @Ndoua
  • Jan 07 2020 03:10
    @bjorno43 banned @doctor-sam
  • Aug 17 2019 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 2019 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 2019 17:13
    @mstellaluna banned @cmal
  • Jan 08 2019 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
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.
CamperBot
@camperbot
gersho sends brownie points to @njm8 :sparkles: :thumbsup: :sparkles:
Gersho
@Gersho
thanks @NJM8
CamperBot
@camperbot
:cookie: 283 | @njm8 |http://www.freecodecamp.com/njm8
Nate Mallison
@NJM8
I guess if it has a class you would just search for that class with getElementByClassName.
Gersho
@Gersho
plural
you'd have the same issue than getElementsByTagName
Nate Mallison
@NJM8
well, so querySelector(element class) actually searches the children of the found element with that class name
korzo
@korzo
@NJM8 I would say it should work
parameter is CSS selector
Nate Mallison
@NJM8
so if you had a ul, and the first li has a class of first, you can find it with querySelector("ul .first");
korzo
@korzo
@NJM8 yes
Long Nguyen
@longnt80
@NJM8 so it's not vague at all
Gersho
@Gersho
but it would aim the li, not the ul
Usman
@halohah
@khaduch thanks!
CamperBot
@camperbot
halohah sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3334 | @khaduch |http://www.freecodecamp.com/khaduch
Usman
@halohah
@piteto Thanks! This actually helps understands some things.
linkin-park
@linkin-park
hi all
Fabien SHAN
@X140hu4
hi
linkin-park
@linkin-park
damn i'm working all alone again on redoing a page from scratch :) just 1 day left :/
i really need your help on this :)
can use css grid or bootstrap ?
linkin-park
@linkin-park
@X140hu4 any thoughts ?
Umurerwa
@Umurerwa08
Hello Fellow campers,
I am stuck on my first project of building a tribute page, can anyone help me as I am inserting a picture into the codes but it's not displaying.
Henry
@GitHub-Henry
@Umurerwa08 Hope this helps