Ok, let's say I have this HTML code, and I want to change the header from within the js code, how would I? I've tried several other solutions from other Q&As but they don't seem to work, either I'm brain dead or stuck. I want to change the header based on a variable, so something like:
header = variablexyz;
<!DOCTYPE html>
<html lang="en">
<head>
<style>
.header {
padding: 60px;
text-align: center;
background: #1746c7;
color: white;
font-size: 50px;
}
</style>
</head>
<body>
<div class="header">
<h1>header</h1>
<p>-randomly generated username-</p>
</div>
<script src="script.js"></script>
</body>
</html>
h1tag that reads 'header', the class header, or the css ruleheader? And what is the variable value - different text, a new class or a new class rule?