Question: Trying to debug my assignment but keep getting this error Uncaught TypeError: Cannot set property 'onclick' of null at window.onload (email_list.js:38) var $ = function(id)

Trying to debug my assignment but keep getting this error Uncaught TypeError: Cannot set property 'onclick' of null at window.onload (email_list.js:38) var $ = function(id) { return document.getElementById(id); }; var joinList = function() { var emailAddress1 = $("email_address1").value; var emailAddress2 = $("email_address2").value; var firstName = $("first_name").value; var errorMessage = ""; // validate the entries if (emailAddress1 == "") { errorMessage = "First email address entry required"; $("email_address1").focus(); } else if (emailAddress2 == "") { errorMessage = "Second email address entry required"; $("email_address2").focus(); } else if (emailAddress2 != emailAddress1) { errorMessage = "Email address entries must match"; $("email_address2").focus(); } else if (firstName == "") { errorMessage = "First name entry required"; $("first_name").focus(); } // submit the form if all entries are valid // otherwise, display an error message if (errorMessage = "") { $("email_form").submit(); } else { alert(errorMessage); } }; window.onload = function() { $("#join_List").click(join_List); $("email_address1").focus(); };

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!