i have string need to be wrapped by tag HTML
with conditional like this:
<h1>Test</h1>
Then nothing will happen
<h1>Test Lagi</h1>
Then the first word will be wrapped by span
, result <h1><span>Test</span> Lagi</h1>
<h1>Test Lagi ah</h1>
Then only the first word will be wrapper by span
, result:
<h1><span>Test</span> Lagi ah</h1>
How to do that in jQuery?