jquery 获取字符串中的数字

    str_num = 'abc123'
    num = parseInt(str_num.replace(/[^0-9]/ig,""));
    alert(num);

 

posted on 2017-04-13 10:03  星河赵  阅读(6964)  评论(0编辑  收藏  举报

导航