Created
February 25, 2021 11:50
-
-
Save numbnet/bd037d55afe7e3d8a7af88ece110a8b8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Название документа</title> | |
</head> | |
<style>tr > td:nth-child(1) {background-color: #f00;}tr>td:nth-child(2) {background-color: #0006ff;}</style> | |
<body> | |
<button onclick="foo()">Создать абзац</button> | |
<script> | |
function foo() { | |
var elem = document.createElement("tr"); | |
elem.innerHTML = "<td>1 БЛОК 1.</td><td>2 БЛОК 2</td>"; | |
document.body.appendChild(elem); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment