Uncaught TypeError: Cannot set property 'innerHTML' of null & Some other.
Hi There,
I was hopping you could help me.
I'm learning Jquery and Java scripts, I have wrote little script which is working fine on local machine, but when I put it on live website it won't work. I'm using business catalyst as my live site.
When I entered my code. It didnt work - I saw this error via inspect element. : " Uncaught TypeError: Cannot set property 'innerHTML' of null " > Onclick and those two :
Uncaught SyntaxError: Unexpected end of input
Uncaught ReferenceError: calculate is not defined
- <script language="javascript">
-
- $ (document) .ready(function() {
-
- });
- function calculate() {
- A = document.FormOne.One.value
- B = document.FormOne.Two.value
- C = (A*B)
-
- document.getElementById("display").innerHTML = C + ('M²');
-
-
- }
-
- </script>
- </head>
-
- <body>
- <form name="FormOne">
- Width: <input class="num" type="number" name="One" size="5" value="" />
- Length: <input class="num" type="number" name="Two" size="5" value="" />
- </form>
-
- <input class="CalBut" type="button" name="button" value="Calculate" onclick="calculate()" />
-
- <div id="display"> </div>
-
- </body>
-
</html>
Any idea what's wrong?
I do have jquery installed on the site - I have even linked it to the google one.
just that you can have look
Thanks
Jiri