Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

135
Vistas
how I can link checkbox with button to open page in JavaScript?

how I can link checkbox with button to open page in JavaScript? I Need When Iam Click To Button All Links open here

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Here's an example.

  1. Create the HTML

  2. In JavaScript, get references to the inputs and the button

  3. Add an event listener on the button. When clicked, perform whatever logic you need to by accessing input.checked to determine if it was checked, and input.value to determine it's value (which is the string associated with the value attribute in the input's HTML)

const inputs = document.querySelectorAll("input")
const button = document.querySelector("button")

button.addEventListener("click", event => {
  alert(
    `The following buttons were checked: ${Array.from(inputs).filter(input => input.checked).map(input => input.value).join(", ")}`
  )
})
button {
  display: block;
  margin: 15px 0;
}
<p>Select your favorite colors:</p>

<label><input type="checkbox" name="color" value="red" /> Red</label>
<label><input type="checkbox" name="color" value="green" /> Green</label>
<label><input type="checkbox" name="color" value="blue" /> Blue</label>

<button>Get Selected Colors</button>

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda