Programming Exercises

Add a single-line input field with validation for a phone number in the format (123) 456-7890 using the pattern attribute.

Hard

Problem Statement

Add a single-line input field with validation for a phone number in the format (123) 456-7890 using the pattern attribute.

Sample Input

A phone input field with validation.

Sample Output

The webpage displays an input field that only accepts phone numbers in a specific format.

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
<!doctype html> <html></html>
Log in or sign up to run or submit your code.Log inSign up
Input
A phone input field with validation.
Expected Output
The webpage displays an input field that only accepts phone numbers in a specific format.