Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

6-3 Homework: Using Array Methods and Event Handlers to Populate Forms In this a

ID: 3679939 • Letter: 6

Question

6-3 Homework: Using Array Methods and Event Handlers to Populate Forms In this assignment you need to create an HTML page that meets the following requirements. The theme and content of the page can be of your choice. (Refer to New Perspectives on HTML, XHTML, and Dynamic HTML 5th edition Tutorial 13) 1) Create an HTML form. 2) Create and Initialize three arrays. 3) Use for-loops to populate those arrays. 4) Add an element to the end of one array. 5) Remove an element from the end of another array. 6) Add a new element to the beginning of one array. 7) Add at least one additional array method of your choice. 8) Convert an array to a string. 9) Use the converted string, assign to a string variable, and use it to populate a form field. 10) Create different functions to handle the operations of steps 4, 5, 6, and 7. (You can create additional array methods.) 11) Create four or more buttons on the form with different event handlers to start the above functions upon clicking them. 12) Create an additional button with an event handler to complete the operation in step 10

Explanation / Answer

/* Filename: formsubmit.js */ var userName = [" bballking", " baller", " iball", " crossover", " 365baller", " posterize", " hooper", " 3pointking", " dudescore", " balldefender", " fullcourthops"]; function init() { var myButton = document.getElementById("btnSubmit"); myButton.onclick = registerName; } function registerName() { var newName = document.getElementById("userName").value.toLowerCase(); var message = ""; var result = document.getElementById("result"); var success = false; if (newName == "") { alert("Please enter a username."); return false; } for (var i = 0; i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote