Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- phone: {
- get: function() {
- return this.value;
- },
- // setter
- set: function(newValue) {
- if (newValue.length === 1) {
- this.value = "(" + newValue;
- } else if (newValue.length === 4) {
- this.value = newValue + ") ";
- } else if (newValue.length === 9) {
- // (282) 922-5555
- // 1234567890
- this.value = newValue + "-";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement