how to add a function in html code example Example: how to use function in javascript /* Declare function */ function myFunc(param) { // Statements }