you should use number inputs so letters cannot be typed in the inputs https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number
@WallNutss
Posted
@palgramming But how do I make the arrow thingy in the input box disappear?
Looking to hire developers?
I'm kinda confused when building this. Like when I add an event listener for user input, I can't instantly update the value that the user inputting, so that's why I call function instead reassign the variable each time event started. Mind tell me why is that? any feedback are welcome
@RocTanweer
Posted
I would use buttons instead of divs for percentage options
@WallNutss
Posted
@RocTanweer I see, I will do that next, thanks. I thought with div I can manipulate them easier. I was wrong
@aUnicornDev
Posted
The e
passed below is the event object which has the latest updated value of the <input>
tag.
inputPrice.addEventListener('input',(e)=>{
//Use e.target.value
price();
})
@WallNutss
Posted
@aUnicornDev Thanks, At first I'm doing that, but I can't access the other value which is the people and the tip. Can you elaborate more how to do that? that's why I passed the event to outside function cause it seems more easier that way
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord