title: Set text in table cell by clicking a button in Javascript
body: <p>I have a problem I wrote a code I have a table and I want to set text to one of my cell in table on button click:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script type="text/javascript"&gt;
  function navratna()
  {
  var y=document.getElementById("navrat");
  y.value="ahoj";
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;table border="1"&gt;
  &lt;tr&gt;
  &lt;td height="20" width="100" id="navrat"&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;input type="button" value="pokus" onclick="navratna()"/&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Please can you help me?</p>