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

186
Views
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 answers
Answer question

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 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!