How would you change the background colour of a div with the id "colourme" to purple?

var div=document.getElementById("colourme"); div.style.backgroundColor = "purple"

GH

Related Javascript Mentoring answers

All answers ▸

How do you create objects in javascript?


How to check if value exists in an object in JavaScript?


What is the difference between let and var when declaring variables in javascript?


Make button that says how many times it has been clicked.