How do I remove letters and dashes and dollar signs in a string using a regular expression?

前端 未结 6 1601
北海茫月
北海茫月 2020-12-23 21:33

I\'m trying to find all letters and dashes and dollar signs and remove them from a text box.

function numbersOnly()
{
    if ($(\'.sumit\').val().indexOf([A         


        
6条回答
  •  囚心锁ツ
    2020-12-23 22:04

    Try something like this:

    function numbersOnly()
    {
        $('.sumit').val().replace(/[\w-$]/g, "");
    }
    

提交回复
热议问题