Create a button labeled Enter new ID Create a div container with an id of your choice
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 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).
Systems analysis and design
ISBN: 978-0136089162
8th Edition
Authors: kenneth e. kendall, julie e. kendall