fix(curriculum): remove obnoxious, bloated library use (#44737)
This commit is contained in:
@ -26,22 +26,22 @@ Camper Cat's Mortal Kombat survey results are in! Wrap a `time` tag around the t
|
|||||||
Your code should have a `p` element which includes the text `Thank you to everyone for responding to Master Camper Cat's survey.` and include a `time` element.
|
Your code should have a `p` element which includes the text `Thank you to everyone for responding to Master Camper Cat's survey.` and include a `time` element.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
assert(timeElement.length);
|
assert(timeElement);
|
||||||
```
|
```
|
||||||
|
|
||||||
Your added `time` tags should wrap around the text `Thursday, September 15<sup>th</sup>`.
|
Your added `time` tags should wrap around the text `Thursday, September 15<sup>th</sup>`.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
assert(
|
assert(
|
||||||
timeElement.length &&
|
timeElement &&
|
||||||
$(timeElement).html().trim() === 'Thursday, September 15<sup>th</sup>'
|
timeElement?.innerHTML?.trim() === 'Thursday, September 15<sup>th</sup>'
|
||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
Your added `time` tag should have a `datetime` attribute that is not empty.
|
Your added `time` tag should have a `datetime` attribute that is not empty.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
assert(datetimeAttr && datetimeAttr.length);
|
assert(datetimeAttr && datetimeAttr?.length);
|
||||||
```
|
```
|
||||||
|
|
||||||
Your added `datetime` attribute should be set to a value of `2016-09-15`.
|
Your added `datetime` attribute should be set to a value of `2016-09-15`.
|
||||||
@ -56,10 +56,10 @@ assert(datetimeAttr === '2016-09-15');
|
|||||||
|
|
||||||
```html
|
```html
|
||||||
<script>
|
<script>
|
||||||
const pElement = $("article > p")
|
const pElement = [...document.querySelectorAll("article > p")]
|
||||||
.filter((_, elem) => $(elem).text().includes("Thank you to everyone for responding to Master Camper Cat's survey."));
|
.filter(x => x?.textContent?.includes("Thank you to everyone for responding to Master Camper Cat's survey."));
|
||||||
const timeElement = pElement[0] ? $(pElement[0]).find("time") : null;
|
const timeElement = pElement[0] ? pElement[0].querySelector("time") : null;
|
||||||
const datetimeAttr = $(timeElement).attr("datetime");
|
const datetimeAttr = timeElement?.getAttribute("datetime");
|
||||||
</script>
|
</script>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user