




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A comprehensive set of solved exercises and questions covering fundamental concepts in html, javascript, and programming. It includes examples of html elements, javascript functions, and programming structures, along with explanations and solutions. Ideal for students studying introductory programming and web development, offering a valuable resource for understanding key concepts and practicing problem-solving skills.
Typology: Exams
1 / 8
This page cannot be seen from the preview
Don't miss anything!





Consider the following HTML paragraph
Here is a paragraph in English.
Match each piece of the HTML element to its descriptor. # opening tag # attribute value # text content # attribute name # closing tag 1.2.
3.id 4."paragraph1" 5.Here is a paragraph in English. - ANSWER- 4 5 3 2 Everything inside the ______ element is shown to the user inside the main browser window. Before this element we will often see a ______ element that contains information about the page rather than information shown on the page. This element usually contains a tag. - ANSWER-body head For each scenario described select the appropriate input/output programming structure you should use to complete the task. # If a programming problem asks you to get the user input from a text field, you would use... # If a programming problem asks you to output some text to a textfield on the webpage, you would use... # If a programming problem asks you to output some value part way through your program for debugging purposes, you would use... # If a programming problem asks you to output some text to the HTML webpage (in say a div or a paragraph), you would use.. 1.let val = document.getElementById("someID").value; 2.document.getElementById("someID").innerHTML = "some text";3.document.getElementById("someID").value = "some text"; 4.console.log(value); - ANSWER- 3 4 2 function doubleOrTriple( x ) { if(typeof(x) !== "number"){ return NaN; } if(50 <= x){ return x2; } else { return x3; } } What value is returned by each of the following function calls?
execute/run.
1.Function invocation 2.Parameters 3.Return value 4.Local variable 5.Global variable - ANSWER- 1 3 2 Match each programming statement to its correct output 8 + "8" NaN == NaN 8 + 8 10 - "a" "abc" <= "abd" typeof 5 1.number 2.true 3.false 4."88"
6.NaN - ANSWER- 3 5 6 2 1 Match each term to its description
#is a keyword/symbol used to combine, modify, or compare one or more expressions #a storage container whose type changes depending on what is being stored #a special type of number that indicates a result is not a valid number #the basic building blocks of JavaScript, includes strings, booleans, and numbers 1.Operator 2.Primitive type 3.Variable 4.NaN - ANSWER- 3 4 2 Match each term with the responsibility it manages in creating a website.
1.HTML 2.CSS 3.JavaScript - ANSWER- 1 2 Order the operators in terms of highest precedence to lowest precedence. The operator that is evaluated (simplified) first should have a 1 next to it, and the operator evaluated last should have a 6 next to it.
Adobe Reader - ANSWER-Google Chrome There are three steps involved in getting the webpage to trigger some JavaScript code. Together these steps are known as event handling. Places these steps in the correct order that they should be done by the programmer.
The function determines if the two parameters have the same type. - ANSWER-The function identifies if the type of the first parameter is the second parameter. Write the traditional DOM event handler (not the HTML event handler or DOM event listener) to make it so that when the button
called btn in the code below, is clicked the sayHello function executes. let btn = document.getElementById("mainBtn"); function sayHello(){ alert("Hello!"); } - ANSWER-btn.onclick = sayHello;