Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1 . Add a element to the body where you'll place JavaScript code for Lab 1 . 2 . Create a variable called name using
Add a element to the body where you'll place JavaScript code for Lab
Create a variable called name using let and assign your full name to it
Use document.writeln to output "Lab Completed by and your name variable using string concatenation.
Use console.log to output "This is Lab Completed by name. Note: press F or go to Tools Developer Tools in you browser to open the Developer Tools. Then in Developer Tools, open "Console" to see the output.
Output content to the div with id"output" using the following assignment statement: document.getElementByIdoutputinnerHTML "This is my first JavaScript lab assignment.";
Add a for loop that outputs all values from Use document.getElementByIdinnerHTML to output the value to the div with id"values". You must output all values using the loop not a single output statement Separate each value with an HTML
element.
Add a while loop that adds all values from together as a sum and output the final value. Use document.getElementByIdinnerHTML to output the value to the div with id"sum".
Create numeric variables a b and c Assign values to them. Output their sum using a document.writeln statement.
Use a condition to compare variables a and b Output a b or a b using a document.writeln statement.
Use an alert to output the value of your name variable and the results of typeof name
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started