Javascript to remove spaces from a textbox value

后端 未结 7 1373
一生所求
一生所求 2020-12-17 00:44

I\'ve searched around for this a lot and can\'t find a specific example of what I\'m trying to do. Basically I want to get the value of a textbox, by the name of the text bo

7条回答
  •  感情败类
    2020-12-17 00:48

    Another, more jQuery'ish option:

    $(".stripspaces").keyup(function() {
        $(this).val($(this).val().replace(/\s/g, ""));
    });
    

提交回复
热议问题