Creating a div element inside a div element in javascript

后端 未结 3 754
挽巷
挽巷 2020-12-05 13:20

I\'m trying a very basic example of creating a div inside an already existing div.

It doesn\'t seem to be working when I use:



        
3条回答
  •  遥遥无期
    2020-12-05 13:31

    Your code works well you just mistyped this line of code:

    document.getElementbyId('lc').appendChild(element);

    change it with this: (The "B" should be capitalized.)

    document.getElementById('lc').appendChild(element);  
    

    HERE IS MY EXAMPLE:

    
    
    
    
    
    
    
    
    
    

提交回复
热议问题