Q
How can you change the font size of an HTML element using JavaScript?

Answer & Solution

Answer: Option A
Solution:
To change the font size of an HTML element using JavaScript, you can modify the style property of the element. For example, element.style.fontSize = 'size'; sets the font size of the element to the specified size.
Related Questions on Average

How can you set the width of an HTML element using JavaScript?

A). element.style.width = 'width';

B). element.width = 'width';

C). element.setAttribute('width', 'width');

D). element.style.width('width');

How can you set the text shadow of an HTML element using JavaScript?

A). element.style.textShadow = 'shadow';

B). element.shadow = 'shadow';

C). element.textShadow = 'shadow';

D). element.style.shadow = 'shadow';

How can you set the margin of an HTML element using JavaScript?

A). element.style.margin = 'margin';

B). element.margin = 'margin';

C). element.setAttribute('margin', 'margin');

D). element.style.margin('margin');

How can you set the text transform of an HTML element using JavaScript?

A). element.style.textTransform = 'transform';

B). element.transform = 'transform';

C). element.textTransform = 'transform';

D). element.style.transform = 'transform';

How can you set the z-index of an HTML element using JavaScript?

A). element.style.zIndex = '100';

B). element.zIndex = '100';

C). element.setZIndex('100');

D). element.style.setZIndex('100');

How can you set the background image of an HTML element using JavaScript?

A). element.style.backgroundImage = 'url('image.jpg')';

B). element.backgroundImage = 'url('image.jpg')';

C). element.style.background = 'url('image.jpg')';

D). element.background = 'url('image.jpg')';

How can you set the overflow property of an HTML element using JavaScript?

A). element.style.overflow = 'hidden';

B). element.overflow = 'hidden';

C). element.style.overflow = 'visible';

D). element.overflow = 'visible';

How can you set the text decoration of an HTML element using JavaScript?

A). element.style.textDecoration = 'decoration';

B). element.decoration = 'decoration';

C). element.textDecoration = 'decoration';

D). element.style.decoration = 'decoration';

How can you set the border style of an HTML element using JavaScript?

A). element.style.borderStyle = 'style';

B). element.border.style = 'style';

C). element.style.border.style = 'style';

D). element.style.style = 'style';

How can you set the cursor style of an HTML element using JavaScript?

A). element.style.cursor = 'pointer';

B). element.cursor = 'pointer';

C). element.style.pointer = 'cursor';

D). element.pointer = 'cursor';