Skip to content

Tag: javascript

How to have a hidden option in a dropdown?

How to have a hidden option in dropdown so that user is unable to see it. Following is the code : User shouldnt be able to see dropdown XYZ option in the dropdown. Mainly it should be hidden.This is because in the backend I’m changing one of the options to this value and proceeding.Kindly help.Thanks in…

JS for loop loops once

My problem is that I am trying to iterate over an array several times, however, my for loop will only iterate over the array once (Or so it seems to me) which causes the outcome to be wrong. What I am trying to do is loop on this array: let arr = [“e5”, “b2”, “a1”, “c…

Very Simple HTML/JavaScript Button Not Working

What should be an incredibly simple button is not working. All I want is for it to log something to the console for some testing purposes, but it refuses to work. There’s the button in my HTML file, and below is the JavaScript that, as far as I can tell, should be working. All I want is for the button

Refactoring a function JS [closed]

i have a problem with my code. First, i did this code and it works well. I have two modals and i wanna to rewrite. // Modal Carrinho const openModal = document.querySelector(‘[data-modal=”open&…