Assessment needed for the topic Manipulating Document. The link to my work is:
The page with the topic
Assessment needed for the topic Manipulating Document. The link to my work is:
The page with the topic
Hello @miracle_ugorji
you doing great
there something you missing
for that line
button.addEventListener('click', 'listItem');
the second parameter is string you should assign function name to it
i also tried to find the function that named listItem
those will lead you to find the other bugs
hope that help and have a nice day
Please I don’t understand. I have no idea what I am doing. If you don’t mind please, what am I missing in the eventlistener function as I can’t figure it out
Please I have made some corrections and its still not working. Help me out.
Hello @miracle_ugorji
i just build one for you based on your code https://jsfiddle.net/jkfs3trc/
hope it help check it and let me know if i have to explain anything
have a nice day
Just checked it out and the site is so not responsive on my device(I use andriod phone).
Or I don’t know how to use it?
Please help me and copy to codepen. Sorry for bothering you so much.
@miracle_ugorji no problem
the js code is
const myUl = document.querySelector('ul');
const myInput = document.querySelector('input');
const myButton = document.querySelector('button');
function clickButton(){
let valueable = myInput.value;
myInput.value='';
let liItem =document.createElement('li');
let mySpan =document.createElement('span');
let internalButton =document.createElement('button');
liItem.appendChild(mySpan);
liItem.appendChild(internalButton);
mySpan.textContent=valueable;
internalButton.textContent="Delete";
myUl.appendChild(liItem);
internalButton.addEventListener('click', del);
input.focus();
}
function del(){
this.parentElement.remove();
}
myButton.addEventListener('click', clickButton);
hope it help and have a nice day
I would never have got it right. thanks for your help. I appreciate.
you will do it
just be patient and when coding make it in small pieces then test those small one then add more and test again and so on
and you welcome