How to call a function inside a function with button (Javascript)?
<p>So my problem is, when I enter this code:</p>

<pre><code>function exemple() {
    var hey;
    function message(){
       hey = true 
    }}

&lt;input type="button" value="hello" onclick="message()"&gt;
</code></pre>

<p>It says ''message is not defined''.... so I was wondering if there is a simple way to call a function inside another function with an onclick event on a button... I've been looking for help on internet and stackoverflow but couldn't find the answer to my question.</p>

<p>Thank you! </p>