Question
1. Create an HTML page and save it as pr11_1.html. Add the necessary script tags to point to an external JavaScript file named prjs11_1.js. Add
1. Create an HTML page and save it as pr11_1.html. Add the necessary script tags to point to an external JavaScript file named prjs11_1.js. Add code so that there is a text box for a phone number with an id of pn and a text area for an address. Beside the phone number text box, there will be an empty span tag with an id of reminder. The body section of the HTML file should look like this when complete:
2. Create an external JavaScript file and save it as prjs11_1.js. Use this for step 3 and step 5.
3. Get the pn and reminder elements by their ids and assign them to the variables pn and rm, respectively.
4. When pn receives focus, change the innerHTML of rm to the text Format: 123-456-7890. When pn is blurred, change the innerHTML of rm to an empty string ().
hint: use document.getElementById() to get node, then use .onfocus to add the event listener.
5. Save the HTML and JavaScript files, and load the HTML page in your browser.
Click inside the text box and a reminder message should appear next to it. Click the text area afterward to blur the text box and make the message disappear.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started