Q:

javascript append


 var node = document.createElement("LI");                 // Create a <li> node

 var textnode = document.createTextNode("Water");         // Create a text node

 node.appendChild(textnode);                              // Append the text to <li>

 document.getElementById("myList").appendChild(node);     // Append <li> to <ul> with id="myList" 
4

        
            
        
     let app = document.querySelector('#app');
app.append('append() Text Demo');

console.log(app.textContent);
0
let parent = document.createElement("div")
parent.append("Some text")

console.log(parent.textContent) // "Some text"
1
var list=[1, 2, 3, 4, 5];
list.push(6);
// .push allows you to add a value to the end of a list 
3
convert string to byte
0

New to Communities?

Join the community