Score:-2

How to apply a JS boolean properly?

kr flag

While working through the application process for a bootcamp, I was tasked with the following JS problem. I was successful in testing through the JS console on Chrome but when I attempt to plug the code into the .js file, it does not work. Do I need to apply a boolean expression? If so, what is the proper way of coding it?

"To make the image bigger or smaller, you have to change its class. In your JavaScript console, run this code:

var thumbnailElement = document.getElementById("smart_thumbnail"); thumbnailElement.className; This displays what the class currently is; it should be "small", unless you changed it since.

To make it big, you should remove the class, by running this:

thumbnailElement.className = ""; To make it small again, you can put it back:

thumbnailElement.className = "small"; See how it changes from small to big? You should put the line that makes it big in your JavaScript file so that it executes when the user clicks."

Artur Meinild avatar
vn flag
Generic programming questions are better suited on [so].
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.