title: Change input value on button click with PHP
body: <p>I have an html button which call a php function on click , and this function change the value of a variable , and beside the button i have a text which display the value of this variable , my question is how can i change immediatly the value and be displayed in the html page ( for example i have the current value '9' , but when i click on button i want it to be 'voila' as done in function ) , i've read that i can do it with AJAX but i dont know how exactly , any help will be appreciated </p>
  
  <p><strong>The Button</strong></p>
  
  <pre><code>&lt;button type="button" class="btn btn-success" onClick="generer()"&gt;Generate&lt;/button&gt;
  </code></pre>
  
  <p><strong>The display input</strong></p>
  
  <pre><code>&lt;a href="#" class="list-group-item disabled"&gt;&lt;?php echo $password; ?&gt;&lt;/a&gt;
  </code></pre>
  
  <p><strong>The PHP code</strong></p>
  
  <pre><code>&lt;?php
   $password = "9";
   function generer(){
             $password = "voila";
          }
   ?&gt;
  </code></pre>