在span标记javascript中包装数字
我有这个密码在span标记javascript中包装数字,javascript,jquery,html,numbers,Javascript,Jquery,Html,Numbers,我有这个密码 数字150与25*6相同 数字175与25*7相同 数字200与25*8相同 数字 var rxp=newregexp(([0-9]+\.?[0-9]+)|([0-9]+),“gm”); $(document.activeElement).keyup(函数(e){ 如果(e.keyCode==13){ e、 预防默认值(); var ths=$(document.activeElement); $(“”).insertAfter(document.activeElement.f
数字150与25*6相同
数字175与25*7相同
数字200与25*8相同
数字
var rxp=newregexp(([0-9]+\.?[0-9]+)|([0-9]+),“gm”);
$(document.activeElement).keyup(函数(e){
如果(e.keyCode==13){
e、 预防默认值();
var ths=$(document.activeElement);
$(“”).insertAfter(document.activeElement.focus();
$(ths).children(“.highlight”).contents().unwrap();
var content=$(ths.html();
$(ths).html(content.replace(rxp,“$1”);
};
$(document.activeElement).children(“.highlight”).contents().unwrap();
var content=$(document.activeElement.html();
$(document.activeElement).html(content.replace(rxp,“$1”);
while($(document.activeElement).children().children().length>0){
$(document.activeElement).children().children().contents().unwrap();
}
});代码>您是否想要获得所有号码150 25 6 175 25 7您能与我们分享您迄今为止的尝试吗?@EMM,为什么您从不接受答案?我想帮忙,但如果你懒得接受答案,我为什么要费心呢?顺便说一句,否决票不是me@AmmarCSE对不起,我忘了,但从现在起我保证我会的,请回答@Dhirajbodichera请看下面的答案。这是答案吗?还是问题的一部分?@JoseRicardoBustosM。部分question@JoseRicardoBustosM. 此代码可以工作,但当某些数字具有span标记(如12321
@JoseRicardoBustosM)时会出现问题。好啊