Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在span标记javascript中包装数字_Javascript_Jquery_Html_Numbers - Fatal编程技术网

在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)时会出现问题。好啊