title: How to remove leading and trailing white spaces from a given html string?
body: <p>I've the following HTML string. What would be sample code in JavaScript to remove leading and trailing white spaces from this string?</p>
  
  <pre><code>&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
  &lt;div&gt;&amp;nbsp;&lt;/div&gt;
  Trimming using JavaScript&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
  all leading and trailing white spaces
  &lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
  &lt;div&gt;&amp;nbsp;&lt;/div&gt;
  </code></pre>