title: Jquery: Dynamically Change href on user input
body: <p>i want to change a link's href based on the user's input, so far i have this:</p>
  
  <pre><code>&lt;input type="text" id="pdf" value="Enter ID" /&gt;
  &lt;a class="target" href="#"&gt;Download&lt;/a&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>function URL() {
  var newurl = $('#pdf').val();
  $('a.target').attr('href', newurl);
  }
  </code></pre>
  
  <p>However this is not working as it was supposed to. I simply want download url to be changed to the value of input text. So if i wrote "123" link would go to "123", but nothing is changing.</p>
  
  <p>Probably i am missing something, i have read the answers about changing href dynamically, but i am kinda stuck here. Either this is not possible or i am doing something wrong.</p>
  
  <p>Thanks</p>
  
  <p>Edit:
  I mistakenly left the function and forgot to call it</p>
  
  <p>Edit 2:
  It now gets the value from text box, but not dynamically changing.</p>