freeCodeCamp/curriculum/challenges/english/01-responsive-web-design/basic-html-and-html5/comment-out-html.md

2.1 KiB

id title challengeType videoUrl forumTopicId
bad87fee1348bd9aedf08804 Comment out HTML 0 https://scrimba.com/p/pVMPUv/cGyGbca 16782

Description

Remember that in order to start a comment, you need to use <!-- and to end a comment, you need to use --> Here you'll need to end the comment before your h2 element begins.

Instructions

Comment out your h1 element and your p element, but not your h2 element.

Tests

tests:
  - text: Your <code>h1</code> element should be commented out so that it is not visible on the page.
    testString: assert(($("h1").length === 0));
  - text: Your <code>h2</code> element should not be commented out so that it is visible on the page.
    testString: assert(($("h2").length > 0));
  - text: Your <code>p</code> element should be commented out so that it is not visible on the page.
    testString: assert(($("p").length === 0));
  - text: Each of your comments should be closed with <code>--&#62;</code>.
    testString: assert(code.match(/[^fc]-->/g).length > 1);
  - text: You should not change the order of the <code>h1</code> <code>h2</code> or <code>p</code> in the code.
    testString: assert((code.match(/<([a-z0-9]){1,2}>/g)[0]==="<h1>" && code.match(/<([a-z0-9]){1,2}>/g)[1]==="<h2>" && code.match(/<([a-z0-9]){1,2}>/g)[2]==="<p>") );

Challenge Seed

<!--
<h1>Hello World</h1>

<h2>CatPhotoApp</h2>

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
-->

Solution

<!--<h1>Hello World</h1>-->
<h2>CatPhotoApp</h2> 
<!--<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p> -->