how to call print function on click in javascript code example Example: js how to print console.log(text);