title: Hiding and showing span in HTML
body: <p>I have a JSP page on which i have some <code>input submit</code> buttons. Now based on some values i get from an <code>AJAX</code> request i want to control the <code>display and hiding of these input buttons</code>. So i have created <code>spans</code> for each input. And based on the variable value i received from AJAX request i manipulate there display property. But i am not getting the results right. </p>
  
  <p>here's my code: </p>
  
  <pre><code>&lt;td style="width: 600px"&gt;&lt;span id="startspan"&gt;&lt;input name="start" value="startActivity" type="submit" id="startbuttonid"&gt;&lt;/span&gt;&lt;/td&gt;
         &lt;td style="width: 600px"&gt;&lt;span id="holdspan"&gt;&lt;input name="start" value="holdActivity" type="submit" id="holdbuttonid"&gt;&lt;/span&gt;&lt;/td&gt;
         &lt;td style="width: 600px"&gt;&lt;span id="cancelspan"&gt;&lt;input name="start" value="cancelActivity" type="submit" id="cancelbuttonid"&gt;&lt;/span&gt;&lt;/td&gt;
         &lt;td style="width: 600px"&gt;&lt;span id="closespan"&gt;&lt;input name="start" value="closeActivity" type="submit" id="closebuttonid"&gt;&lt;/span&gt;&lt;/td&gt;
  </code></pre>
  
  <p>And my <code>java script</code> code where i am writing code for display or hiding them is :: </p>
  
  <pre><code>if(temp1[15]=="InProcess"){
          document.getElementById('startspan').style.display='none';
          document.getElementById('holdspan').style.display = 'block';
          document.getElementById('cancelspan').style.display = 'block';
          document.getElementById('closespan').style.display = 'block';
      }
      if(temp1[15]=="New"){
          document.getElementById('startspan').style.display='block';
          document.getElementById('holdspan').style.display = 'none';
          document.getElementById('cancelspan').style.display = 'block';
          document.getElementById('closespan').style.display = 'none';
      }
  </code></pre>
  
  <p>here based on variable <code>temp1[15]</code> value which i am receiving fine. I want to display or hide those input submit buttons. I am doing it the right way, like defining span or need some correction. Basically all those input buttons are inside a <code>dialog box &lt;div&gt;</code> which opens up only when a function is triggered inside which i have written my Hiding or showing span code(Written above). Need help. Thanks. </p>