Benos,
или
<p> строка 39
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
</head>
<body>
<script>
var runId = setTimeout(runFN, 1000);
function runFN(){
console.log("Запустили скрипт!");
myCSS();
HTML();
}
function myCSS(){
console.log("Создали CSS");
var css = ".myClass { width: auto; height: auto; background-color: rgba(184, 178, 169, 0.65); right: 230px; top: 100px; z-index: 3000; position: absolute; border: 1px solid rgba(232, 229, 225, 0.9); margin: 10px; max-width: 400px; padding: 2px;}";
css += ".myClassContent {background-color: rgba(255, 255, 255, 0.85); margin: 10px; border: 1px solid #7b746e; padding: 8px 10px; word-wrap: break-word; }";
var nodeCSS = document.createElement("style");
nodeCSS.type = "text/css";
nodeCSS.innerHTML = css;
var heads = document.getElementsByTagName("head");
heads[0].appendChild(nodeCSS);
}
function HTML(){
console.log("Создали HTML");
var parent = document.getElementsByTagName('BODY')[0];
var myNode = document.createElement('DIV');
myNode.className = 'myClass';
myNode.id = 'myEl';
myNode.innerHTML = '<p class="myClassContent">Тестовый контент</p>';
parent.appendChild(myNode);
}
</script>
</body>
</html>