title: Why onchange event taking me to new page?
body: <p>I am trying to populate a text field with the value of the select field.
  So based on the selection the text field should change.
  In this case, I am selecting First Name and Last name of the person and in the</p>
  <pre><code>option value=&quot;I have person email here&quot;
  </code></pre>
  <p>Now, I am using <code>onchange</code> event on select element which calls the <code>findemail()</code> function.
  Problem is I am getting the correct emails return but
  <strong>it redirect me to another page and show me the value there.</strong></p>
  <p>Can anyone please help me?</p>
  <p>CODE</p>
  <pre><code>    function findemail(e)
  {
      document.getElementById('man-email-add').innerHTML=document.write(e.value);
  }
  </code></pre>
  <p>HTML (I am using PHP to get all the values)</p>
  <pre><code>&lt;select id=&quot;manager_detail&quot; onchange=&quot;findemail(this.options[this.selectedIndex]);&quot;&gt;            
  
  
  &lt;?php 
  
      foreach ($data['display']['userMangers'] as $manager){
        echo   $manEmail = $manager['Email'];
        echo &quot;&lt;option value='$manEmail'&gt;&quot;.$manager['First_Name'].' '.$manager['Last_Name'].'  ('.$manager['Position'].')'.'&lt;/option&gt;';
  }
      
  ?&gt;
  
  
                                &lt;/select&gt;    
  </code></pre>
  <p>Redirect to new page to show the value:</p>
  <p><img src="https://i.stack.imgur.com/pNXFC.png" alt="enter image description here" /></p>