document.getElementById innerHTML not displaying

前端 未结 3 1289
说谎
说谎 2021-01-07 09:36

This should be a pretty easy thing to do, but it\'s not returning anything. The function love() should kick off, getting a simple number prompt, and spitting out a list of a

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-07 10:08

    navPoints are not valid html elements, so the browser doesn't know what to do with them. They are being added to the DOM, just not displayed unless you add styling to do so.

    If you replace them with paragraph tags, it works fine. See the example here.

    
    
    
    

    Begin!

提交回复
热议问题