Lesson 10
ID: 3744696 • Letter: L
Question
The webpage BrokeCode.html won't run. See if you can find the error.
1. Document the steps you tried to find the problem based on any troubleshooting procedures.
2. Document the problem and the solution.
3. Attach the corrected document.
<!DOCTYPE html>
<html>
<head>
<title>Lesson 10</title>
<script type="text/javascript">
function addNumb(fname,lname){
x=fname+lname
return x;
}
function showname(fname,lname){
alert("funrun");
document.write("<h2>Your first name is: +fname+"</h2>");
document.write("<h2>Your last name is: +lname+ "</h2>");
}
</script>
</head>
<body>
Explanation / Answer
1) / should be escaped with one more / 2) closing " missing for string in document.write Fixed code: ------------ Lesson 10 function addNumb(fname,lname){ x=fname+lname return x; } function showname(fname,lname){ alert("funrun"); document.write("Your first name is: "+fname+""); document.write("Your last name is: "+lname+ ""); } showname("Cristiano", "Ronaldo");
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.