title: Display text in div when javascript onclick
body: <p>I've multiple buttons with related text to each button, when user click on the button, the text should change according to button and text should be displayed in the DIV. </p>
  
  <p>I'm using if elseif to choose between the text for each button, now I'm unable to go through the function to pass the text to the div onclick().</p>
  
  <pre><code>&lt;html&gt;  
     &lt;head&gt;  
        function display (selected) {  
           if (decision == firstbox)  {  
              display = "the text related to first box should be displayed";  
           }  else if (decision == secondbox)  {  
              display = "Text related to 2nd box.";  
           }  else  {  
              display ="blank";  
           } 
     &lt;/head&gt;  
     &lt;body&gt;  
        &lt;input type="button" id="firstbox" value= "firstbox" onclick="display(firstbox)" /&gt;&lt;br&gt;    
        &lt;input type="button" id="secondbox" value= "secondbox" onclick="display(firstbox)" /&gt;&lt;br&gt;
     &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>