Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

123
Views
HTMLElement: Evento change does´t works

I've used this code on the page and it doesn't work in the browsers I've tried it on. Can you help me correct the error?

<label>Elija un sabor de nieve:
    <select class="nieve" name="nieve">
        <option value="">Seleccione Uno …</option>
        <option value="1">Chocolate</option>
        <option value="2">Sardina</option>
        <option value="3">Vainilla</option>
    </select>
</label>

<div class="resultado"></div>
<script>

const selectElement = document.querySelector('.nieve');
selectElement.addEventListener('change',(event) => {
    const resultado = document.querySelector('.resultado');
    resultado.textContent = 'Te gusta el sabor ${event.target.value';
    });
</script>

This line show an error: "selectElement.addEventListener('change',(event) => {". When selecting an item from the dropdown, it should specify the selected item in text.In Dreamweaver it shows an error on the indicated lines and in Firefox it shows "Do you like the flavor ${event.target.value}".

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

const selectElement = document.querySelector('.nieve');
selectElement.addEventListener('change',(event) => { 
    const resultado = document.querySelector('.resultado'); 
  resultado.textContent = `Te gusta el sabor ${event.target.value}`;
});
<label>Elija un sabor de nieve:
<select class="nieve" name="nieve">
    <option value="">Seleccione Uno …</option>
    <option value="1">Chocolate</option>
    <option value="2">Sardina</option>
    <option value="3">Vainilla</option>
</select>
<div class="resultado"></div>

about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!