@mukwende2000
Posted
First of all never use var to declare variables, use either const or let e.g
const number = 5
let letter = 'a'
This is the recommended way and that is what everyone does
secondly make sure all your functions have descriptive names, instead of del, give it something like deleteNum(since delete is a keyword) and clear instead of cls
Never do
<button onclick="funct()"></button>
put all the code to do with event listeners in the javascript file,
To make the code work this way, you can use the same approach you used to do the theme switching
const btns = document.querySelectorAll('button')
btns.forEach(btn => {
btn.addEventListener('click', handleClick)
})
You can then add the login for making the text on the button appear on the screen
how do you make it better,
i will encourage you to look at solutions from other members and learn something from how they approached, i did this challenge as, you can check mine if you want. But its just the beginning continue practicing and make sure you getting better everyday and learning new things. Good luck.
Marked as helpful
@PearlPerfect
Posted
@mukwende2000 Really helpful. Thank you, I will try to implement it.