Write a JavaScript that inputs the telephone number as a string in the form of (555) 555 –
5555. The script should use string method split to extract the area code as a token. The first three digit of the phone number as a token, the last four digits of the phone number as a token. Display the area code in one text field and seven digit phone numbers in another text field.
1
Expert's answer
2012-04-10T08:04:02-0400
var telephone = document.getElementById('telephone').split('(').join(''); var code = telephone.split(')')[0]; document.getElementById('first_text_field').value = code; document.getElementById('second_text_field').value = telephone;
You must replace names in getElementById with real Id's of your project.
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment