Home > Back-end >  How to call this function in HTML?
How to call this function in HTML?

Time:12-25

hello every one I have a java script function that want to call in html can anyone help? this is my function:

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

            result = '<button  data-toggle="tooltip" data-placement="right" title="ویرایش مقادیر سطح کاربری" onclick="DefaultModal(\'ویرایش مقادیر\', \'EditLevel/'   id   '\')" style="margin-left: 5px"><i ></i></button>';
            return result;
        }

CodePudding user response:

Make a button

<button onclick='editLevel(/* id */)'></button>

CodePudding user response:

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

  • Related