Answers for "call javascript function from html"

1

call function in javascript from html

<div>
    <button onclick="YourFunction()" value="CallMyFunction"></button>
</div>

<script>
    function YourFunction() {
        console.log("Hello Word")
    }
</script>
Posted by: Guest on January-27-2022
2

running a function in a function javascript

function runFunction() {
  myFunction();
}

function myFunction() {
  alert("runFunction made me run");
}

runFunction();
Posted by: Guest on September-22-2020
0

javascript function call with variable

function abc() {
  alert('test');
}

var funcName = 'abc';

window[funcName]();
Posted by: Guest on March-30-2020

Code answers related to "call javascript function from html"

Code answers related to "Javascript"

Browse Popular Code Answers by Language