Convert Text in a Span
I need to force the word views to be Chinese characters in this without changing the number before it.
<span class="title_date">591 views</span>
I was gonna use
I know the characters here does not say views, I'm just using it as an example.
But that would remove the number. Any ideas?
Use a regular expression with something like this (whitout jQuery).
The $1 is the first subpattern of the regular expression (one or more digits followed by ) and the characters 看法 could say view or views ?
var str='<span class="title_date">591 views</span>';
This works for each individual string, but I need to do it dynamically based on the class. I have 300 of these that all need to be changed as soon as the page loads. I don't have the time to write it out 300 times for each string as well as the number variables change. I need to be able to change it based class title_date and skip what ever number is there and only change the string views.
Originally Posted by 007Julien
Sorry I didn't explain that before.
Then use jQuery to replace the strings ! With something like this (jQuery is not my cup of the)