capitalize the character of a string whenever it gets space
<p>I want to capitalize the  character of a string whenever it gets space,but not change the other letters.
Eg.</p>

<pre><code>the mango tree -&gt; The Mango Tree
an elephant gone -&gt; An Elephant Gone
the xyz hotel -&gt; The Xyz Hotel
</code></pre>

<p><strong>in javascript</strong></p>
