var a='123<span>456</span><span class="active">789</span>'; a.replace(/<span .+?>(.*)</span>/g, '$1')
比如就这样操作