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

351
Views
How to call this function in HTML?

I have a JavaScript function that I want to call in HTML. Can anyone help? This is my function:

function editLevel(id) {
  var result = '';

  result =
    '<button class="btn btn-warning" data-toggle="tooltip" data-placement="right" title="ویرایش مقادیر سطح کاربری" onclick="DefaultModal(\'ویرایش مقادیر\', \'EditLevel/' +
    id +
    '\')" style="margin-left: 5px"><i class="fa fa-edit"></i></button>';
  return result;
}
about 4 years ago · Juan Pablo Isaza
3 answers
Answer question

0

Make a button

<button onclick='editLevel(/* id */)'></button>
about 4 years ago · Juan Pablo Isaza Report

0

You could use document.addEventListener('DOMContentLoaded', myFunction) and it will execute your function when the page loads.

about 4 years ago · Juan Pablo Isaza Report

0

    function Onetest() {
        let A, B, C, D, result;

        A = 46;
        B = 64;
        C = 43;
        D = 24;

        result = A + B + C + D;

        document.getElementById("demo").innerHTML = result;
    }

    <p id="demo"></p>
    <input type="button" value="+" onclick="Onetest()">
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!