--- id: 68cae5b538ff798bbd4da004 title: "Challenge 66: HTML Tag Stripper" challengeType: 28 dashedName: challenge-66 --- # --description-- Given a string of HTML code, remove the tags and return the plain text content. - The input string will contain only valid HTML. - HTML tags may be nested. - Remove the tags and any attributes. For example, `'Click here'` should return `"Click here"`. # --hints-- `stripTags('Click here')` should return `"Click here"`. ```js assert.equal(stripTags('Click here'), "Click here"); ``` `stripTags('

Hello World!

')` should return `"Hello World!"`. ```js assert.equal(stripTags('

Hello World!

'), "Hello World!"); ``` `stripTags('Cat')` should return an empty string (`""`). ```js assert.equal(stripTags('Cat'), ""); ``` `stripTags('
section
section
')` should return `sectionsection`. ```js assert.equal(stripTags('
section
section
'), "sectionsection"); ``` # --seed-- ## --seed-contents-- ```js function stripTags(html) { return html; } ``` # --solutions-- ```js function stripTags(html) { return html.replace(/<[^>]*>/g, ''); } ```