Attributes Flashcards

1
Q

What is the purpose of name/value pairs in HTML?

A

They appear in the opening tag and provide information about the functionality or element.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are global attributes in HTML?

A

Global attributes can appear in any HTML element.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are element-specific attributes?

A

Element-specific attributes apply to a specific element.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which HTML attributes are case-sensitive?

A

The id and class attributes are case-sensitive.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do boolean attributes behave in HTML?

A

Boolean attributes are always true if present and omitted if false.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are enumerated attributes in HTML?

A

Enumerated attributes have limited predefined values with a default value and are not automatically true if omitted.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the purpose of the id attribute in HTML?

A

The id attribute uniquely identifies elements, useful for linking, scripting, accessibility, and styling. It is case-sensitive and unique across the document.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How does the for attribute in <label> work?

A

The for attribute links the label to the form control’s id, providing accessibility and better form interaction.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the role of the class attribute in HTML?

A

The class attribute is used to target elements with CSS, with its value being a space-separated list of case-sensitive classes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does the style attribute do in HTML?

A

The style attribute applies inline CSS styles to the element.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the purpose of the tabindex attribute?

A

The tabindex attribute enables an element to receive focus, with integer values (e.g., -1 for no focus).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does the role attribute do in HTML?

A

The role attribute provides semantic meaning to content without affecting browser behavior.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the purpose of the data- prefix in HTML?

A

The data- prefix allows the creation of custom attributes, which can store extra information on HTML elements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly