Homework Help Question & Answers

We are going to use the developer tools and the DOM function document.QuerySelectorAll(css_selector_string) to test some...

We are going to use the developer tools and the DOM function document.QuerySelectorAll(css_selector_string) to test some selectors and look at document structure.

a.What is the CSS selector that you would use to select all the <code> elements? How many are there?

b.What is the CSS selector that you would use to select all the <code> elements contained in <pre>elements? How many are there? Are there more or less than above. Why?

c.What is the CSS selector that you would use to select all the <figure> elements? How many are there?

d.What is the CSS selector that you would use to select all the <img> elements? How many are there? Is this different from the above? Why?

0 0
Add a comment
Answer #1

Sign Up to Unlock the answer FREE

Already have an account? Log in

//a.
var code = document.QuerySelectorAll("code");
console.log("Total <code> elements: "+code.length);
//b.
var preCode = document.QuerySelectorAll("pre>code");
console.log("Total <code> elements in <pre> tag: "+preCode.length);
console.log("Is code.length is > preCode.length");
console.log(code>preCode);
//c.
var figures = document.QuerySelectorAll("figure");
console.log("Total <figure> elements: "+figures.length);
//d.
var img = document.QuerySelectorAll("img");
console.log("Total <img> elements: "+img.length);
console.log(img.length+">"+figures.length+"="+(img.length>figures.length));

Add a comment
Know the answer?
Add Answer to:
We are going to use the developer tools and the DOM function document.QuerySelectorAll(css_selector_string) to test some...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coin

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
  • Fake News This exercise is about modifying the content of a page in your web browser using Javascript. As we have said, Javascript has access to the current page via the Document Object Model or DOM....

    Fake News This exercise is about modifying the content of a page in your web browser using Javascript. As we have said, Javascript has access to the current page via the Document Object Model or DOM. In your browser, the variable document represents the current document and your code can use it to read and write to the current page. In this exercise we will use the developer tools Javascript console to write Javascript to access parts of the main...

  • Please help as much as you can it’s pretty much just terms What is the main purpose of the python-requests module? What kinds of requests can it make, and what types of responses might be returne...

    Please help as much as you can it’s pretty much just terms What is the main purpose of the python-requests module? What kinds of requests can it make, and what types of responses might be returned? Text? HTML? JSON? Images? What is JSON? How does it compare to CSV? Whern processed using the json.loads) method, what Python data structure does the imported JSON get imported as. What is an HTML Document Object Model (DOM) and how does that relate to...

  • WEB230 - JavaScript 1 Assignment 6a Use Events and DOM manipulation to create a playable Tic...

    WEB230 - JavaScript 1 Assignment 6a Use Events and DOM manipulation to create a playable Tic Tac Toe game. Do the following using JavaScript. Do not modify the HTML file. When you see this symbol: save and refresh the browser (this should happen automatically if you are using Brackets with Live Preview), then check your code to make sure it is working before you proceed. 1. Create two variables called "playerX" and "playero". Set them to the DOM element with...

  • 1.Use Chemdraw to construct the alpha-ketoamide inhibitor and place it in a word document. одо alpha-ketoamide...

    1.Use Chemdraw to construct the alpha-ketoamide inhibitor and place it in a word document. одо alpha-ketoamide inhibitor 2. Cirele, Color Code, use letters, numbers or arrows ete, to identify by name as many functional groups as you can in the alpha-ketoamide inhibitor. Variations in the functional group count. For example a l' and 2 "alcohol, if present, would represent two functional groups. 3. Identify the parts of this molecule that are reflected in its name. 4. Mark all of the...

  • 2. A) We require you to describe how you would use project management tools to develop and implement a project plan. Dis...

    2. A) We require you to describe how you would use project management tools to develop and implement a project plan. Discuss at least 3 tools from below: Activity (What is to be done?) Objective (Why will we do it?) Resources (Where will it be done?) Procedures (How will it be done?) Responsible person (Who will do it?) When? Budget Acquire additional resources – delivery van. To provide a delivery service and provide brand recognition Purchase a new van for...

  • javascript

    In this project you will write the JavaScript code to create a calculator. Good thing is that everyone knows how the calculator works. It is a challenging project, give yourself lots of time to complete it.1. You are provided with an HTML, and CSS files.. Look at these files to understandhow to use them and modify them if needed based on your code. (Note: You can adddifferent selector (id, class) in HTML ONLY and cannot make any changes to CSS.)Create...

  • IN EXCELL We are now going to use Excel to test a hypothesis based on one...

    IN EXCELL We are now going to use Excel to test a hypothesis based on one given sample. We would like to know if the average cholesterol level of patients in intensive care is equal to 200 and for that reason we collect cholesterol level of 20 random people from various intensive care units. I Cholesterol level 154,168,134,201,208,220,225,228,201,207,168,211,203,254,268,198,298,135,154,189 We put our data in column A. In Cells A3-A22 we type our data and in cell Al we type Cholesterol. First...

  • Hi!, having trouble with this one, In this class we use visual studio, C++ language --------------------------------------------------------------...

    Hi!, having trouble with this one, In this class we use visual studio, C++ language -------------------------------------------------------------- Exercise #10 Pointers - Complete the missing 5 portions of part1 (2 additions) and part2 (3 additions) Part 1 - Using Pointers int largeArray (const int [], int); int largePointer(const int * , int); void fillArray (int * , int howMany); void printArray (const char *,ostream &, const int *, int howMany); const int low = 50; const int high = 90; void main()...

  • Stochastic Population Growth Model Next, we are going to monitor the population growth of an asexually reproducing single-celled organism, centinia lincolni (pennies). This Centina population has a m...

    Stochastic Population Growth Model Next, we are going to monitor the population growth of an asexually reproducing single-celled organism, centinia lincolni (pennies). This Centina population has a mortality rate of 50% per year, but all individuals that survive the year divide to produce an additional individual. The very most basic growth model of a closed population is: N+ N-deaths births Rewritten to use rates instead of individuals, this equation becomes: N+ -N,S+N.BS where S is the probability of survival (0.5)...

  • Please answer for all the subparts, explaination is not necessary, only answers will suffice. 1) How...

    Please answer for all the subparts, explaination is not necessary, only answers will suffice. 1) How many startDocument events and how many startElement events will be fired when the following XML SAX parser? <a> <b q='yyy'>zzz</b> <c>nnn</c> <d>ppp</d> </a> a) O startDocument events and 4 startElement events b) O startDocment events and 3 startElement events c) 1 startDocment events and 4 start Element events d) 1 startDocment events and 3 startElement events 2) The bracket in the following is an...

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
Active Questions
ADVERTISEMENT