Answers for "add to html list javascript"

11

appendchild javascript

const parent = document.createElement('div');
const child = document.createElement('p');
const childTwo = document.createElement('p');
parent.append(child, childTwo, 'Hello world'); // Works fine
parent.appendChild(child, childTwo, 'Hello world');
// Works fine, but adds the first element and ignores the rest
Posted by: Guest on August-13-2020
0

to htmlhow can i add the list in javascript

$(document).ready(function() {
    $("<li>")
    .html('Scooter')
    .appendTo('ul');
});
Posted by: Guest on December-15-2021

Browse Popular Code Answers by Language