I am trying to make a function that will render the toDo items as list items in the unorderedList
Create a function renderList that renders the todo items from toDos as list items in the unordered list, make sure that the function is dynamic and that it gets invoked at when while loading the page
How do yo do this in Jquery?
const body = $("body");
const header =$("<header>Todo List</header>")
const unorderedList = $("<ul>unorderedlist</ul>")
var toDos = ["wake up","eat breakfast","code"];
/*const renderList function()=>{
{
*/
body.append(header)
body.append(unorderedList)
body.append(toDos);
") which ul to choose, what if i had multiple in the code ?
How does this function start and finish, what if I wrote code below it, is the code a part of it ? or does it end after you append
– Adam.M Aug 06 '21 at 03:25"` as opposed to `"ul"`), jQuery creates a new element for you. If you wanted to select a particular element that was already in the document, you would just use a selector like `$("#id-of-element")`
– Phil Aug 06 '21 at 03:27