I\'m trying to figure out function that will help me wrap first word in string into span.
But unfortunately no luck.
Can anyone help me please?
Many
You ask how to do that in jQuery. I think you'll need a regular expression to litteraly add the span.
Here is an example using jQuery to get a text from the DOM and make the update in the DOM after having added the span to the string with a regular expression.
This is the text
This is what you'll get:
This is the text