You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove old code editor and "active learning" from Emphasis and importance (#39827)
* Remove old code editor and active learning from Emphasis and importance
* Update files/en-us/learn_web_development/core/structuring_content/emphasis_and_importance/index.md
Co-authored-by: Brian Smith <brian@smith.berlin>
---------
Co-authored-by: Brian Smith <brian@smith.berlin>
@@ -77,142 +77,60 @@ You can nest strong and emphasis inside one another if desired:
77
77
78
78
{{EmbedLiveSample('Strong importance')}}
79
79
80
-
## Active learning: Let's be important
80
+
## Let's play with emphasis and importance
81
81
82
-
In this active learning section, we've provided an editable example. Inside it, we'd like you to try adding emphasis and strong importance to the words you think need them, just to have some practice.
82
+
In this section, we want you to play with emphasis and importance:
83
83
84
-
```html hidden
85
-
<h2>Live output</h2>
84
+
1. Click **"Play"** in the code block below to edit the example in the MDN Playground.
85
+
2. In the main heading give the word "Emphasis" emphasis, and the word "importance" strong importance.
86
+
3. In the first paragraph, give the coffee machine name strong importance, and emphasize the adjectives used to describe the coffee.
87
+
4. In the second paragraph, give the temperature description ("cold") and the action you should take ("wrap up warm to avoid falling ill") strong importance. Give "falling ill" some extra markup so it is both emphasized and important.
If you make a mistake, you can clear your work using the _Reset_ button in the MDN Playground. If you get really stuck, you can view the solution below the code block.
88
90
89
-
<h2>Editable code</h2>
90
-
<pclass="a11y-label">
91
-
Press Esc to move focus away from the code area (Tab inserts a tab character).
<summary>Click here to show the solution</summary>
144
115
145
-
consthtmlSolution=
146
-
"<h1>Important notice</h1>\n<p>On <strong>Sunday January 9th 2010</strong>, a gang of <em>goths</em> were spotted stealing <strong><em>several</em> garden gnomes</strong> from a shopping center in downtown <strong>Milwaukee</strong>. They were all wearing <em>green jumpsuits</em> and <em>silly hats</em>, and seemed to be having a whale of a time. If anyone has <strong>any</strong> information about this incident, please contact the police <strong>now</strong>.</p>";
147
-
let solutionEntry = htmlSolution;
148
-
149
-
reset.addEventListener("click", () => {
150
-
textarea.value= code;
151
-
userEntry =textarea.value;
152
-
solutionEntry = htmlSolution;
153
-
solution.value="Show solution";
154
-
updateCode();
155
-
});
156
-
157
-
solution.addEventListener("click", () => {
158
-
if (solution.value==="Show solution") {
159
-
textarea.value= solutionEntry;
160
-
solution.value="Hide solution";
161
-
} else {
162
-
textarea.value= userEntry;
163
-
solution.value="Show solution";
164
-
}
165
-
updateCode();
166
-
});
167
-
168
-
textarea.addEventListener("input", updateCode);
169
-
window.addEventListener("load", updateCode);
170
-
171
-
// Stop tab key tabbing out of textarea and
172
-
// make it write a tab at the caret position instead
173
-
textarea.onkeydown= (e) => {
174
-
if (e.code==="Tab") {
175
-
e.preventDefault();
176
-
insertAtCaret("\t");
177
-
}
178
-
179
-
if (e.code==="Escape") {
180
-
textarea.blur();
181
-
}
182
-
};
183
-
184
-
functioninsertAtCaret(text) {
185
-
constscrollPos=textarea.scrollTop;
186
-
let caretPos =textarea.selectionStart;
187
-
188
-
constfront=textarea.value.substring(0, caretPos);
189
-
constback=textarea.value.substring(
190
-
textarea.selectionEnd,
191
-
textarea.value.length,
192
-
);
193
-
textarea.value= front + text + back;
194
-
caretPos +=text.length;
195
-
textarea.selectionStart= caretPos;
196
-
textarea.selectionEnd= caretPos;
197
-
textarea.focus();
198
-
textarea.scrollTop= scrollPos;
199
-
}
116
+
Your finished HTML should look like this:
117
+
118
+
```html
119
+
<h1><em>Emphasis</em> and <strong>importance</strong></h1>
200
120
201
-
// Update the saved userCode every time the user updates the text area code
202
-
textarea.onkeyup= () => {
203
-
// We only want to save the state when the user code is being shown,
204
-
// not the solution, so that solution is not saved over the user code
205
-
if (solution.value==="Show solution") {
206
-
userEntry =textarea.value;
207
-
} else {
208
-
solutionEntry =textarea.value;
209
-
}
210
-
211
-
updateCode();
212
-
};
121
+
<p>
122
+
My new coffee machine is called <strong>The Percolator 2000</strong>. It
123
+
produces the most <em>sublime</em> and <em>wonderful</em> brew.
124
+
</p>
125
+
126
+
<p>
127
+
In the dead of winter, it will be <strong>cold</strong>. You should
128
+
<strong>wrap up warm to avoid <em>falling ill</em></strong
0 commit comments