<div class="jb51code">
<pre class="brush:js;">
<span id="span_id">span2314的23文本213
var htmlobj = txt.replace(/(\d+)/img,"$&");
//var htmlobj = txt.replace(/([+-]?[0-9]+(.[0-9]+)?)/g,"$1"); // 这个也可以
//var htmlobj = txt.replace(/(\d+)/img,"$1");//这个也可以
alert("替换spna中的数字:"+htmlobj);
$("#span_id").html(htmlobj);