When input button is clicked, perform an action
<p>Here's my code:</p>

<pre><code>&lt;script&gt;
 $("#btn1").click(function(){
  baseURL='http://domain.com/base1';
  $("input#Race").val("btn2");
  $("input#Race").attr("id","btn2");
 });
 $("#btn2").click(function(){
  baseURL='http://domain.com/base2';
  $("input#pet").val("btn1");
  $("input#pet").attr("id","btn1");
 });
&lt;/script&gt;
&lt;td&gt;&lt;input class="inputbutton" id="btn1" type=button value="btn1"&gt;&lt;/td&gt;
</code></pre>

<p>What's supposed to happen, when you click the button, it changes between btn1 and btn2 and also change the baseURL variable.</p>

<p>But when I click the button, nothing happens.</p>
