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

163
Views
How does button surrounded with <p><a> and <button> differes?

Bootcamp sample html file suggests a button written like this:

<p><a class="btn btn-primary btn-lg" onclick="run_update()" role="button">Button</a></p>

Though, I've written button always like this

<button class="btn btn-primary" onclick="run_update()">Button</button>

They seems identical and functions similarly. I'm wondering are they any different or will they impact performance everso slighly?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

For this, always go for .addEventListener() instead of onclick. onclick is not recommended for executing an action in JS.

MDN (Mozilla Developer Network)
also states that .addEventListener must be used instead of onclick.

For the button, it doesn't affect the overall meaning and work of it. A button doesn't cause a change when inside a p tag.

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!