without wrapping the tag around certain words, you cannot highlight it (or, as I said, at least I donβt know how to do it). but if there is no problem with wrapper tags, you should use regEx.
for words starting with @:
replace(/@([^ ]+)/g, '<span class="atsign">@$1</span>');
and for words starting with C #:
status.replace(/#([^ ]+)/g, '<span class="hashtag">#$1</span>');
check this script
EDIT: you can replace
var status = 'I tweeted something #one #two @three @four';
with
var status = $('#phrase').text();
source share