Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript

function dodavanjeToDoObjekata() {
	let add = document.querySelector('#add').value;

	let newElement = document.createElement('div');
	newElement.classList = 'add-element';
	newElement.innerHTML = `${add}` + `<button onclick="removeObj()">x</button>`;

	document.querySelector('.lista').appendChild(newElement);

}

function removeObj() {
	let brisanje = document.querySelector('.add-element');
	brisanje.remove();
}
Source by www.roblox.com #
 
PREVIOUS NEXT
Tagged: #javascript
ADD COMMENT
Topic
Name
7+3 =