Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Santa's Phone Number Formatter ๐ŸŽ…๐Ÿ“ž

๐ŸŽฏ Task Write a JavaScript function that takes a 10-digit phone number as input and formats it into the following structure:

๐Ÿ“‹ Requirements Accept a 10-digit string as input. Validate that the input is exactly 10 digits and contains only numbers. Return the formatted phone number in the structure (000) 000-0000. If the input is invalid, throw an error indicating the issue.

๐Ÿ“ž Example Santaโ€™s contact example: Input: "8005551212" Output: "(800) 555-1212"

๐Ÿ“‚ Project Structure HTML file: Provides a simple form for users to enter a phone number. CSS file: Adds visual styling to make the interface user-friendly. JavaScript file: Contains the logic for validating and formatting the phone number.

๐Ÿš€ How to Use Clone the repository to your local machine. Open the HTML file in your browser. Enter a 10-digit phone number in the provided input field. Click the "Format" button to view the formatted number or an error message ๐ŸŽ…โœจ.

About

Phone Number Formatter

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages