title: Changing the width of a button in jquery
body: <p>I'm trying to change the width of a button to match the width of the text box above it in jquery. I have tried to accomplish this by using the following line:</p>
  
  <pre><code>$("#myButton").css("width", $("#textbox").width());
  </code></pre>
  
  <p>In the code below:</p>
  
  <p><a href="http://jsfiddle.net/4EfAJ/2/" rel="nofollow">JSFiddle</a></p>
  
  <p>JQuery:</p>
  
  <pre><code>$('#tabs').tabs();
  $("#myButton").css("width", $("#textbox").width());
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div id="tabs"&gt;
      &lt;ul&gt;
          &lt;li&gt;&lt;a href="#tabs-1"&gt; Tab 1&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#tabs-2" id="productTab"&gt;Tab 2&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
      &lt;div id="tabs-1" class="buttons" class="ui-widget"&gt;
      &lt;/div&gt;
      &lt;div id="tabs-2"&gt;
          &lt;table&gt;
              &lt;tr&gt;
                  &lt;td&gt;
                      &lt;input type="text" id="textbox" /&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;
                      &lt;button id="myButton"&gt;My Button
                      &lt;/button&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
      &lt;/div&gt; 
  &lt;/div&gt;
  </code></pre>
  
  <p>I believe that since I am using tabs, the width of the text box is not immediately available.</p>