jquery: Maintaining the same button size given changes in the text
<p>I have the following piece of code:</p>

<pre><code>$(document).ready(initialize);

function initialize() {
    $('#btnPoint').css('width', $('#btnPoint').width());
}
</code></pre>

<p>When I debug it in Chrome <code>$('#btnPoint').width()</code> is 83 before the width is set. But it becomes 67 immediately after the <code>css</code> statement is executed.</p>

<p>What is going on?</p>

<p><strong>EDIT</strong></p>

<p>I have no particular stylesheets loaded. Here is my html page:</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
  &lt;head&gt;
    &lt;meta name="viewport" content="initial-scale=1.0, user-scalable=no" /&gt;
    &lt;style type="text/css"&gt;
      html { height: 100% }
      body { height: 100%; margin: 0; padding: 0 }
    &lt;/style&gt;
    &lt;script type="text/javascript"
      src="http://maps.googleapis.com/maps/api/js?key=bla-bla-bla&amp;sensor=false&amp;libraries=geometry"&gt;
    &lt;/script&gt;
    &lt;script type="text/javascript" src="jquery.min.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="sdr.js"&gt;&lt;/script&gt;
&lt;/head&gt;
  &lt;body&gt;
    &lt;div style="display: table; height: 100%; width: 100%;"&gt;
        &lt;div id="data" style="display: table-row; height: 20px;"&gt;
            &lt;div style="display: table-cell;"&gt;
                &lt;input id="btnPoint" type="button" value="Mark the point" onclick="markPoint()" /&gt;
                Point: &lt;input id="txtPoint" type="text" /&gt;&lt;br /&gt;
                &lt;input id="btnPolygon" type="button" value="Mark the polygon" /&gt;
                Polygon:&lt;input id="txtPolygon" type="text" /&gt;
             &lt;/div&gt;
        &lt;/div&gt;
        &lt;div style="display: table-row; "&gt;
            &lt;div id="map_canvas" style="display: table-cell;"&gt;&lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
  &lt;/body&gt;
&lt;/html&gt;
</code></pre>
