Question
Create a button labeled Enter new ID Create a div container with an id of your choice to display youroutput from JavaScript. Create a JavaScript
Create a button labeled “Enter new ID”
Create a div container with an id of your choice to display youroutput from JavaScript.
Create a JavaScript file
a. Add click event to the button (Enter new ID) sothat invokes a function each time it is clicked. Your functionshould perform following operations:
? prompts user to enter a GBLearn ID. You will need to useRegExp inside try & catch block to evaluatewhether the id is in a proper format, if not, throw an error todisplay alert message to user in your catch block). As you know,all GBLearn IDs begin with a lowercase letter for each season (wfor winter, s for summer...), followed by 7 digits. Ifuser input is in a valid format, create a new h3 elementand embed user’s input as a new text node to theh3 element, then append it to the div container created above(in your HTML document).
Step by Step Solution
3.43 Rating (153 Votes )
There are 3 Steps involved in it
Step: 1
Answer and step by step explanation HTML Enter new ID JavaScript get the elements const enterIDButto...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