Computer Science, asked by Kuyung36, 1 year ago

How to create and apply CSS to JavaScript Alert box?

Answers

Answered by mahima23112003
0

var elem = document.querySelector('#some-element');

// Set color to purple

elem.style.color = 'purple';

// Set the background color to a light gray

elem.style.backgroundColor = '#e5e5e5';

// Set the height to 150px

elem.style.height = '150px';

<div id="some-element" style="color: purple; background-color: #e5e5e5; height: 150px;">

Hello, world!

</div>

Similar questions