$('p').each(function(){
var me = $(this)
, t = me.text().split(' ');
me.html( '<strong>'+t.shift()+'</strong> '+t.join(' ') );
});
Run Code Online (Sandbox Code Playgroud)
这个大胆的第一个字.
要么
$('p').each(function(){
var me = $(this);
me.html( me.text().replace(/(^\w+)/,'<strong>$1</strong>') );
});
Run Code Online (Sandbox Code Playgroud)