convert jquery to plain JS : How do i convert this jquery code to plain plain JS?

        $("#txtTestNumbersOnlyRegex").keyup(function () { 
        var newValue = $(this).val().replace(/[^0-9]/g,'');
        $(this).val(newValue);    
     });  
Thanks!!