Split string with multiple separator in jQuery

If you want to split a string with multiple separators then you have to pass regex expression into split method. In below example I have used three character (, : -) as separator.

var numbers = '1,2:3-4';
var numArray = numbers.split(/,|:|-/);

CODE
<!DOCTYPE html>
<html>
<head>
  <title>jQuery With Example</title>
  <script src="http://code.jquery.com/jquery-1.9.1.js" type="text/javascript"></script>
  <script type="text/javascript">
    $(function () {
      $('.btnClick').click(function () {
        var numbers = '1,2:3-4';
        var numArray = numbers.split(/,|:|-/);

        for (var i = 0; i < numArray.length; i++) {
          alert(numArray[i]);
        }
      });

    });
  </script>
</head>
<body>
  <div>
    <button class="btnClick">Click</button>
  </div>
</body>
</html>

DISPLAY