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

188
Vistas
Why onclick function doesnt work inside <div> tag in svelte?

I am developing VS code extension. For that, I used WebView to show user interface and perform some task in it. So that I used svelte to customize my WebView panel.

My problem is, I created svelte file that contain Styles,JS,HTML. So when I call onclick method inside the tag, it won't work but when it is place out of the tag it is work. WHY IS THAT HAPPEN? how can I solve this?

<h1 style="text-align:center" on:click={microphoneOnAndOff}>Click Me</h1> **--// This work**

<div class="box">
    <div class="object">
           <div class="outline" style="display: none;"></div>
           <div class="outline" id="delayed" style="display: none;"></div>
           <div class="buttonStyle"></div>
           <div class="buttonStyle" id="circlein">
           <svg  on:click={microphoneOnAndOff} class=""></svg> **--// This Not work**
           </div>
    </div>
</div> 

Anyone can help me to solve this problem?

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

0

hello you can use svg in a tag

      <a href="" onclick="clicked"><svg class=""></svg></a> **--// This work** :)
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