html - JavaScript simple echo/print query -


I know that this is the basic thing, but after a few hours of research on Google, this site and the other I just Can not come with the explanation of why this code does not work and it is not, can anybody make a mistake? Many thanks in advance:

Javascript bits:

  & lt; Script language = "text / javascript" & gt; Function myFunction () {var date1; . DATE1 = getElementByID ("DATE1") Price; Document.getElementById ("calculation") innerHTML = DATE1. } & Lt; / Script & gt;   

HTML bit (which definitely works and its large file form, with loads of tables)

  & lt; Html & gt; & Lt; Top & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Div id = "wrap" & gt; & Lt; H2 & gt; JavaScript & lt; / H2 & gt; & Lt; Form & gt; & Lt; Table & gt; & Lt; TR & gt; & Lt; Th & gt; Input  gt; & Lt; / Td> & Lt; / Th & gt; & Lt; / Tr & gt; & Lt; / Table & gt; & Lt; / Form & gt; & Lt; Table & gt; & Lt; TR & gt; & Lt; Th bgcolor = "# eeaaaa" align = center> & Lt; Em> & Lt; / Em> & Lt; Input type = button id = payment id = "calculation" size = 15 value = "click" & gt; & Lt; / L & gt; & Lt; / Tr & gt; & Lt; / Table & gt; & Lt; Table & gt; & Lt; TR & gt; & Lt; Th & gt; & Lt; P id = "count" size = 15> & Lt; / P & gt; & Lt; / TD & gt; & Lt; / Th & gt; & Lt; / TR & gt; & Lt; / Table & gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt;   

a

A

I have tried different things already, changing the syntax, clearing the disorder, but nothing seems to work.

I have a creative comment / I appreciate the criticism.

Your second input should be unique to id .

  & lt; Script language = "text / javascript" & gt; Function myFunction () {var date1; . DATE1 = document.getElementById ("DATE1") Price; Document.getElementById ("calculation") innerHTML = DATE1. } & Lt; / Script & gt;   

And most importantly, you are not calling myfonction

Comments