전체 글40 Background image If you write Line 10,12 both -> the image is devidedbecause you call the image twice. so if you want to put this image as a backgrounddocument.body.style.backgroundImage = `url('img/${chosenImage}')`; 2024. 9. 1. Weather 8.0 Geolocation 1. function navigator.geolocation.getCurrentPosition() 1) getCurrentPosition(argument1, argument2) (argument1) the function that will be called if everything is okay. (argument2) the function that will be called if there is an error. 2) Declare function for getCurrentPositionfunction onGoeOk(){}, functiononGeoError(){}function onGoeOk(position){ const lat = position.coords.lat.. 2024. 8. 31. To do list (2) 7.6 Deleting To Dos part1problem - We don't know which todo text to delete in the databasegoal 1 - Give this todos a sort of ID ex: [{id:121212, text:"drink"}] 1) Create the objectconst newTodoObj = { text: newTodo, id: Date.now(),} * Date.now()-> the function that you can call. It gives you the milliseconds the second everything. 2) Push newTodoObj into toDos arraytoDos.push(newTodoObj); 3.. 2024. 8. 29. To do list (1) 7.0 Setup 1) add and in html2) make const toDoForm/toDoList by using getElementByIdconst toDoForm = document.getElementById("todo-form");const toDoInput = document.querySelector("#todo-form input")const toDoList = document.getElementById("todo-list"); 3) make a function 'handleToDoSubmit' - delete event setting -> event.preventDefault(); 4) change the value to empty.function handleToDoSubmit.. 2024. 8. 28. 이전 1 2 3 4 ··· 10 다음