title: My javascript codes won't work?
body: <p>My Html page codes : </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;&lt;meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0"&gt;
  &lt;meta name="apple-mobile-web-app-capable" content="yes" /&gt;
  &lt;meta name="mobile-web-app-capable" content="yes" /&gt;
    &lt;/head&gt;&lt;link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"&gt;
  &lt;link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.indigo-pink.min.css"&gt;
      &lt;script&gt;
          function LengthConverter() 
          {
          var inchRef,inchtoCmResultRef;
          var inch,centimetres;
          inchRef=document.getElementById("inchToCmValue");
          inchtoCmResultRef=document.getElementById("inchtoCmResult");
          inch=Number(inchRef.value);
          centimetres=Number(inchtoCmResultRef.value)
          centimetres=2.54*inch
          inchtoCmResultRef.innerText=centimetres;
        
          }
          function LengthConvertercmToinch()
          {
          var inch2Ref,cmtoInchResultRef;
          var inchTwo,centimetresTwo;
          inch2Ref=document.getElementById("cmToInchValue");
          cmtoInchResultRef=document.getElementById("cmToInchRe");
          inchTwo=Number(inch2Ref.value);
          centimetresTwo=Number(cmtoInchResultRef.value)
          inchTwo=centimetresTwo/2.54
          cmtoInchResultRef.innerText=inchTwo;
          }
      &lt;/script&gt;
  &lt;script defer src="https://code.getmdl.io/1.3.0/material.min.js"&gt;
      
      &lt;/script&gt;
    &lt;body&gt;
          &lt;!-- Always shows a header, even in smaller screens. --&gt;
  &lt;div class="mdl-layout mdl-js-layout mdl-layout--fixed-header"&gt;
    &lt;header class="mdl-layout__header"&gt;
      &lt;div class="mdl-layout__header-row"&gt;
        &lt;!-- Length --&gt;
        &lt;span class="mdl-layout-title"&gt;Length&lt;/span&gt;
        &lt;!-- Add spacer, to align navigation to the right --&gt;
        &lt;div class="mdl-layout-spacer"&gt;&lt;/div&gt;
        &lt;!-- Navigation. We hide it in small screens. --&gt;
        &lt;nav class="mdl-navigation mdl-layout--large-screen-only"&gt;
          &lt;a class="mdl-navigation__link" href=""&gt;Length&lt;/a&gt;
          &lt;a class="mdl-navigation__link" href="Mass.html"&gt;Mass&lt;/a&gt;
        &lt;/nav&gt;
      &lt;/div&gt;
    &lt;/header&gt;
    &lt;div class="mdl-layout__drawer"&gt;
      &lt;span class="mdl-layout-title"&gt;Change conversion&lt;/span&gt;
      &lt;nav class="mdl-navigation"&gt;
        &lt;a class="mdl-navigation__link" href=""&gt;Length&lt;/a&gt;
        &lt;a class="mdl-navigation__link" href="Mass.html"&gt;Mass&lt;/a&gt;
      &lt;/nav&gt;
    &lt;/div&gt;
    &lt;main class="mdl-layout__content"&gt;
      &lt;div class="page-content"&gt;&lt;div class="mdl-grid"&gt;
    &lt;div class="mdl-cell mdl-cell--4-col"&gt;&lt;h3&gt;Centimetres to inches&lt;/h3&gt;
  &lt;!-- Numeric Textfield with Floating Label --&gt;
  &lt;form action="#"&gt;
    &lt;div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label"&gt;
      &lt;input class="mdl-textfield__input" type="text" pattern="-?[0-9]*(\.[0-9]+)?" id="cmToInchValue"&gt;
      &lt;label class="mdl-textfield__label" for="cmToInchValue"&gt;Centimetres...&lt;/label&gt;
      &lt;span class="mdl-textfield__error"&gt;Input is not a number!&lt;/span&gt;
    &lt;/div&gt;
  &lt;/form&gt;
  &lt;!-- Raised button with ripple --&gt;&lt;h4&gt;Inches:&lt;/h4&gt;
  &lt;span id="cmToInchRe"&gt;&lt;/span&gt;&lt;button class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect" onclick="LengthConvertercmToinch()"&gt;Convert to Inches&lt;/button&gt;
  &lt;/div&gt;
    &lt;div class="mdl-cell mdl-cell--4-col"&gt;&lt;h3&gt;Inches to centimetres&lt;/h3&gt;
  &lt;!-- Numeric Textfield with Floating Label --&gt;
  &lt;form action="#"&gt;
    &lt;div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label"&gt;
      &lt;input class="mdl-textfield__input" type="text" pattern="-?[0-9]*(\.[0-9]+)?" id="inchToCmValue"&gt;
      &lt;label class="mdl-textfield__label" for="inchToCmValue"&gt;Inches...&lt;/label&gt;
      &lt;span class="mdl-textfield__error"&gt;Input is not a number!&lt;/span&gt;
    &lt;/div&gt;
  &lt;/form&gt;
  
  &lt;!-- Raised button with ripple --&gt;&lt;h4&gt;Centimetres:&lt;/h4&gt;
  &lt;span id="inchtoCmResult"&gt;&lt;/span&gt; &lt;button onclick="LengthConverter()" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect"&gt;Convert to Centimetres&lt;/button&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
    &lt;/main&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I know it's a long piece of code but I can't find the mistake?</p>
  
  <p>I basically copied the codes from the material design lite(mdl)website to get the interface to create a webpage to convert cm to inches and vice versa and it also links to a webpage for mass by making minor changes to the code.</p>
  
  <p>I input the converting function and onclick function myself.</p>
  
  <p>But only the right side of the webpage works while the left column returns null?Help will be much appreciated.</p>