wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

CSS and JQuery

Total questions: 9

Worksheet time: 5mins

Name
Class
Date
1.

The "#" is used to select an html element by its:

a)

class

b)

id

c)

name

d)

data attribute

2.

The "." is used to select an html element by its:

a)

favorite color

b)

id

c)

class

d)

name

3.

The following is correct syntax for CSS


p { color: red; }

a)

True

b)

False

4.

When would the following code be run


$(function() {});

a)

When the user requests the page

b)

When the user pushes a button

c)

After all the elements are loaded

d)

Never

5.

CSS stands for

a)

Cascading Style Sheets

b)

Creative Style Settings

c)

Compact Software Settings

d)

Creative Setting Selectors

6.

Which of the following is selected by $('.foo')?

a)

<p>Foo</p>

b)

<img id='foo'></img>

c)

<div class='foo'></div>

d)

<foo></foo>

7.

Which of the following is selected by $('#bar')?

a)

<div class='bar'></div>

b)

<p data-bar='bar'></p>

c)

<h1>bar</h1>

d)

<img id='bar'></img>

8.

which of these CSS selectors would select all of the <img> tags in a <div>

a)

img div

b)

img.div

c)

div img

d)

div.img

9.

Given the following, what would $('.foo').data('info') return?


<div id='foo' data-info='google' data-test='bar'></div>

a)

google

b)

bar

c)

div

d)

undefined