The document does not change color
function changeme() {
var color = "#";
var letras = "0123456789ABCDEF";
function random() {
for (var i=0; i<6; i++) {
color += letras[Math.floor(Math.random() * 16);
}
return color;
}
function setcolor() {
document.getElementById("changeme").setAttribute("style", "color:" random(););
}
return random();
}
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="learn.js"></script>
<style>
#forEach {width: 300px; height: 100px; background-color: red; position: relative;}
#forClasico {width: 300px; height: 100px; background-color: blue; position: relative;}
#forin {width: 300px; height: 100px; background-color: green; position: relative;}
#changeme {width: 300px; height: 100px; background-color: green; position: relative;}
</style>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<!-- <div id="forEach">
<h4 style="text-align:center;">Simplex forEach LOOP(array start w/ 1)</h4>
</div>
<div id="forClasico">
<h4 style="text-align:center;">Simplex for LOOP(1 - 10)</h4>
</div>
<div id="forin">
<h4 style="text-align:center;">Simplex forin(at the moment in array)</h4>
</div>--->
<div id="changeme" onclick="changeme()">
<h4 style="text-align:center;">Changing the bgcolor(click to change for random color);</h4>
</div>
</body>
</html>