mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-22 11:36:11 -05:00
1.6 KiB
1.6 KiB
id, title, challengeType, dashedName
| id | title | challengeType | dashedName |
|---|---|---|---|
| 642def66e6a60432c9a0371e | Step 4 | 0 | step-4 |
--description--
Set the className of the label element to label, and set the textContent to the name parameter.
--hints--
You should access the className property of the label element.
assert.match(code, /label\.className/);
You should set the className property to the string label.
assert.match(code, /label\.className\s*=\s*('|"|`)label\1/);
You should access the textContent property of the label element.
assert.match(code, /label\.textContent/);
You should set the textContent property to the value of name.
assert.match(code, /label\.textContent\s*=\s*name/);
--seed--
--seed-contents--
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="./styles.css" />
<title>Functional Programming Spreadsheet</title>
</head>
<body>
<div id="container">
<div></div>
</div>
<script src="./script.js"></script>
</body>
</html>
#container {
display: grid;
grid-template-columns: 50px repeat(10, 200px);
grid-template-rows: repeat(11, 30px);
}
.label {
background-color: lightgray;
text-align: center;
vertical-align: middle;
line-height: 30px;
}
--fcc-editable-region--
window.onload = () => {
const container = document.getElementById("container");
const createLabel = (name) => {
const label = document.createElement("div");
}
}
--fcc-editable-region--