GithubHelp home page GithubHelp logo

cisc3140's Introduction

Objective

The objective is to create an input mask that formats telephone numbers in real-time.

It should present a user entered phone number xxxxxxxx as something like xxx-xxx-xxxx. Note: Choosing the - here as it is slightly easier to implement than with () characters for (XXX) XXX - XXXX. We will assume US phone numbers to keep it simple. The presented example uses Brooklyn College's phone number, 718-951-5000

The user will be entering in 1 key at a time.

When 3 characters have been entered, a - should append the input to yield XXX-.

When 6 characters have been entered, a - should append the input again to yield XXX-XXX-

And finally after 10 characters have been entered, it should not accept any further input.

Directions

Treat the feature development as a series of steps.

If you've considerable experience with JS and comfortable designing your own implementation, feel free to design and execute your vision for this telephone formatter.*

Otherwise, use the TODOs listed in the provided files is the suggested implementation tasks. Complete each of the TODOs specified, each TODO should be its own commit:

  • 4 in script.js
  • 1 in style.css

Those are the minimal requirements.

Enhancing the HTML would be awesome but not required. An impressive submission of this exercise may lead to extra credit points.

Helpful hint

Use the JavaScript console of a browser to test during your development process. Instructions for accessing this console from your browser are shown at https://javascript.info/devtools

Testing/Grading

I will be testing your work with Chrome. I will test with the provided example 7189515000 as well as a handful of random strings 3-12 characters in length.

In terms of scoring, if the requirements specified are met, I will count 1 point per TODO successfully completed, plus another point for submitting. Please maintain the use of vanilla JavaScript.

References - Official specification documents

These are provided as helpful points of reference. You may search for other materials.

cisc3140's People

Contributors

ritchycal avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.