Saturday, 29 October 2016

jQuery - exclude all non numeric charachters in string

watch this example on YouTube



<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
   
    <script  type="text/javascript" src="Scripts/jquery-1.10.2.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            var test = 'afda21432 afdasf 43243';
            var res = test.replace(/\D/g, '');
            alert(res);
        });
    </script>
</head>

No comments:

Post a Comment