Question

Question 1: Given the following HTML code segment <p>While this is a <b> very basic HTML...

Question 1: Given the following HTML code segment

<p>While this is a <b> very basic HTML document </b>, it actually serves as a detailed example of the document object model. </p>

How many text nodes will be added to the DOM tree to represent the structure of text content in this HTML code segment

A. 1

B. 2

C. 3

D. 4

Question 2: Assume in an HTML document named “index.html”, the following <script> element is added

<script src="grocery.js"></script>

This script element tells browser that “grocery.js” is in the same folder that contains “index.html”

A. True

B. False

Question 3: After the statement that follows is executed,

var rateText = document.getElementById("rate");

rateText  represents______________________________.

A. the HTML element object with “rate” as its id.

B. none of these

C. The string that was entered in the HTML element with “rate” as its id.

D. the value that was entered in the HTML element with “rate” as its id

Question 4: Given the following HTML code segment

<ul>

<li id="two" class="hot">pine <em>nuts</em></li>

<li id="three" class="hot">honey</li>

<li id="four">balsamic vinegar</li>

</ul>

After exectuting the following JavaScript code,

var items = document.querySelectorAll('li');

console.log (items.length);

What will be displayed in the console?

A. 4

B. 1

C. 2

D. 3

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer for Q1)

2 [Because there are two elements b,p]

Answer for Q2)

Actually this doesn't tell anything to the browser explicitly. Implicitly it's understood by the browser.

Answer for Q3)

The value was entered in HTML element with "rate"as it's I'd.

Answer for Q4)

3

Add a comment
Know the answer?
Add Answer to:
Question 1: Given the following HTML code segment <p>While this is a <b> very basic HTML...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • <!DOCTYPE html> <html> <head> <!-- JavaScript 6th Edition Chapter 4 Hands-on Project 4-3 Author: Da...

    <!DOCTYPE html> <html> <head> <!-- JavaScript 6th Edition Chapter 4 Hands-on Project 4-3 Author: Date:    Filename: index.htm --> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Hands-on Project 4-3</title> <link rel="stylesheet" href="styles.css" /> <script src="modernizr.custom.05819.js"></script> </head> <body> <header> <h1> Hands-on Project 4-3 </h1> </header> <article> <div id="results"> <p id="resultsExpl"></p> <ul> <li id="item1"></li> <li id="item2"></li> <li id="item3"></li> <li id="item4"></li> <li id="item5"></li> </ul> </div> <form> <fieldset> <label for="placeBox" id="placeLabel"> Type the name of a place, then click Submit: </label> <input type="text" id="placeBox"...

  • USE THE GIVEN STARTER HTML & JS FILES (DON'T NEED CSS FILE): Using a state machine...

    USE THE GIVEN STARTER HTML & JS FILES (DON'T NEED CSS FILE): Using a state machine design pattern and keypress() create a website that can capture user keyboard input. Each time the user types in something and hits <enter> a new TODO list item will be added to the panel. Using click() add a reset button that clears the list. $(document).ready(function() { $("li").css("id", "uw"); const states = ["idle", "gather", "process"]; var state = states[0]; var words = new Array (...

  • JavaScript (Please debug this code) When a user enters a string in the input box, the...

    JavaScript (Please debug this code) When a user enters a string in the input box, the program is designed to add the string to an array. When the array reaches a certain length, the program displays all the users' entries in a list on the page. When you finish debugging, the user's entry in the input box should be cleared each time the submit button is clicked. Additionally, after five strings are submitted, the entire list of submitted strings should...

  • in the following java script code follow the instructions provided <!DOCTYPE html> <html> <head> <!-- JavaScript...

    in the following java script code follow the instructions provided <!DOCTYPE html> <html> <head> <!-- JavaScript 6th Edition Chapter 5 Hands-on Project 5-2 Author: Date:    Filename: index.htm --> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Hands-on Project 5-2</title> <link rel="stylesheet" href="styles.css" /> <script src="modernizr.custom.05819.js"></script> </head> <body> <header> <h1> Hands-on Project 5-2 </h1> </header> <article> <h2>Change of address form</h2> <form> <fieldset id="contactinfo"> <label for="addrinput"> Street Address </label> <input type="text" id="addrinput" name="Address" /> <label for="cityinput"> City </label> <input type="text" id="cityinput" name="City"...

  • NEED HELP with HTML with Javascript embedding for form validation project below. I have my code...

    NEED HELP with HTML with Javascript embedding for form validation project below. I have my code below but I'm stuck with validation. If anyone can fix it, I'd really appreciate. ****************************************************************************** CODE: <!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <html> <head> <title>Nice</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script> var textFromTextArea; function getWords(){ var text =...

  • This question relates to Javascript. Could you please show me why my code is not working?...

    This question relates to Javascript. Could you please show me why my code is not working? I want to create 2 text boxes and have the user enter something into both of them. If the text entered into both boxes is identical the a green message is made visible. If the boxes are different a red message is made visable. Please keep it simple because I am new to javascript. <html> <head>               <title></title>        <script>...

  • Unit 1 Programming Assignment Follow the directions for each of the following questions. Answer the question...

    Unit 1 Programming Assignment Follow the directions for each of the following questions. Answer the question or provide the code in a space below the question. 1. Write the complete script tag set for a script whose line statement is document.write(“Hello, world.”); 2. Build a complete HTML document and include the answer to the previous question such that the page executes the script as the page loads. Open the document in your browser to test the results. 3. Add a...

  • Given a starting sphere code, modify the Java and HTML code to create multiple spheres that...

    Given a starting sphere code, modify the Java and HTML code to create multiple spheres that will rotate in different positions at different speeds. basicSphere.js: "use strict"; var canvas; var gl; var numTimesToSubdivide = 3; var index = 0; var pointsArray = []; var va = vec4(0.0, 0.0, -1.0,1); var vb = vec4(0.0, 0.942809, 0.333333, 1); var vc = vec4(-0.816497, -0.471405, 0.333333, 1); var vd = vec4(0.816497, -0.471405, 0.333333,1); var program; var program1; function triangle(a, b, c) {    pointsArray.push(a);...

  • In this problem, you will create a selectable “To Do” List. To add a task to...

    In this problem, you will create a selectable “To Do” List. To add a task to this list, the user clicks the Add Task button and enters a description of the task. To delete a task from the list, the user selects the task and then clicks the Delete Task button. Open the HTML and JavaScript files provided as start-up files (index.html from within todo_list_Q.zip file). Then, review the HTML in this file. Note, within the div element, there is...

  • This is my code so far: <!DOCTYPE html> <html> <head> <title>JavaScript is fun</title> <meta charset="utf-8" />...

    This is my code so far: <!DOCTYPE html> <html> <head> <title>JavaScript is fun</title> <meta charset="utf-8" /> </head> <body> <script type ="text/javascript"> //declare a variable and store text in it var x = "JavaScript is fun"; //write the variable 5 times document.write(x + x + x + x + x); //store 5 as string in variable x x = "5"; //store 3 as string in variable y var y = "3"; //write the value x + y to the document document.write("<br>");...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT