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

1 Expert Approved Answer
Step: 1 Unlock

Answer and step by step explanation HTML Enter new ID JavaScript get the elements const enterIDButto... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Electrical Engineering Questions!