title: How to get value from php variable into our javascript file?
body: <p>Actually, I have created a user profile page in which I have added a button to "update info"
  as for example:</p>
  
  <pre><code>&lt;span id="username"&gt; Username:  &lt;?php echo $username; ?&gt;
  &lt;span id="password"&gt; Password:  &lt;?php echo $password; ?&gt;
  </code></pre>
  
  <p>In this page initially I have taken value of username and password using php/mysql commands from database.</p>
  
  <p>Now, I have created a JavaScript file to change innerHTML of id username/password whenever I click "update info", I wanted to add something like as shown bellow:</p>
  
  <pre><code>function update()
  {
  
  document.getElementById('username').innerHTML=' Username:  &lt;input type="text"    id="uname" name="uname" value="&lt;?php echo $username; ?&gt;"&gt;';
  
   }
  </code></pre>
  
  <p>But I am not getting value of username, I am just getting same php script within input text field.</p>
  
  <p>How to do this in order to get value of "$username" which I was getting directly in main page? </p>