title: Trying to change a link on button click with javascript
body: <p>I have three buttons and i want such tha when i click on one button the link on an <code>a</code> tag changes</p>
  
  <pre><code>&lt;a  class="payverlink" href="exbronzeregistrationform.php"&gt;Continue to registration&lt;/a&gt;
  
  &lt;button class="goldpac"&gt;Choose Plan&lt;/button&gt;
  &lt;button class="silverpac"&gt;Choose Plan&lt;/button&gt;
  &lt;button class="bronzepac"&gt;Choose Plan&lt;/button&gt;
  </code></pre>
  
  <p>I want such that when i click on one button, it changes the link at <code>.payverlink</code></p>
  
  <p>I have tried</p>
  
  <pre><code>function bronze()
      {
          $('.payverlink').href="exbronzeregistrationform.php";
      }
      function silver()
      {
          $('.payverlink').href="exsilverregistrationform.php";
      }
  
  &lt;button class="silverpac" onclick="silver()"&gt;Choose Plan&lt;/button&gt;
  &lt;button class="bronzepac" onclick="bronze()"&gt;Choose Plan&lt;/button&gt;
  </code></pre>
  
  <p>But this changes to bronze function onclick of any of the buttons. Please whats the issue.</p>