Functions error

<html>
<title>
    functions
    </title>
    <body>
        <p>practise functions</p>
        <p id="fun"></p>
        <script>
            var x= function(a,b)
            {
                return a*b;
                document.getElementById("fun").innerHTML=x;
            }
            
        
        </script>
        
    </body>
</html>


can anyone help me why i am not getting the o/p properly…
I don’t no I am feeling functions are tough… irritated …

I’ve edited your post for readability. When you enter a code block into the forum, precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

markdown_Forums

Nothing is calling your function.

Tq for editing code …

to call the function … function(a,b); …

That’s declaring it. Nothing tells it to run.

I am confused …
I need to learn … then I will change my code …
TQ for helping … :slight_smile: