How to make a function in javascript

Declare a function in javascript

<h2 align="center">Make a function in javascript</h2>

<button onclick="myFunction()">Check function</button>

<script>
function myFunction() {
    alert('This is javascript function.');
}
</script>

Related Sourcecode

More Sourcecode

×
Google login
SignUp with Email
X