The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Why does my one link at CodePen just loads to a white page?

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #262545

    I tried adding some simple JS functionality to my page at CodePen, but I just can’t seem to get past this one problem: the one link in my CodePen-page just goes to a white page for some reason. I have no idea why this even happens. I tried adding preventDefault(), but that didn’t work either.

    What have I done wrong? All my other links goes to nothing, as they should. It’s just this one link in my mobile layout. Not even the console log works, strangely enough.


    It’s because the element also has an inline event inside the HTML itself:


    Binding events directly precedes the addEventListener method:

    So that’ll work despite the inline event (it overwrites it).

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.