<script>
var arr=[];
arr[0]="12345678901";
arr[1]="21345678901";
var reg=/^1\d{10}$/;
// Or you can write like this :"var reg=/1[0-9]{10}/",etc.
for(var i=0;i<arr.length;i++)
{
if(reg.test(arr[i]))
console.log(arr[i]+" is a right telephone number");
else
console.log(arr[i]+" is a wrong telephone number");
}
</script>
Result:
12345678901 is a right telephone number
21345678901 is a wrong telephone number