I am taking LinkedIn Learning’s Introduction to Web Design and Development and am stuck.
My HTML and CSS codes are great and get the same results the instructor gets. However, when I copy and paste her Javascript nothing happens.
Codes are below -
HTML -
<button class="Click Me">Click Me</button>
<section class="hidden">
<h1>Look what I'm learning!</h1>
<p>When clicked a button will reveal this text.</p>
<p>Click again, and the text will hide away!</p>
</section>
I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.
You need to add the clickme class to your button for it to work.
But also, I would suggest reviewing the first few projects of responsive web design certification on freeCodeCamp so you can better understand how classes work.
That way you will better understand why your code isn’t working.