Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialIgnazio Calo
Courses Plus Student 1,819 PointsHow to add a spoiler button on our community?
Hallo, I have a bit of experience in writing code and I gave some user some advices and the right answer to the challenge. I would like to keep the full answer "hidden" until the user decide to click the "spoiler" button.
Does someone knows how we can do? If it's not possible, what the best way to communicate with the product team and suggest this feature?
thanks!
2 Answers
Michael Hulet
47,913 PointsI think this type of thing used to be possible by just writing some code in a <script>
tag and your code would be compiled along with the rest of the markdown, but it no longer is. Allowing users to inject JavaScript into a webpage represents a cross-site scripting attack, which is rather dangerous and hard to handle properly. However, if you want to suggest this as a full-fledged feature, I suggest emailing support
Rob Allessi
8,600 PointsHowdy Ignazio Calo
Just a friendly reminder that posting the answers to code challenges is against the rules. Please refrain from outright providing answers, and instead help other students by guiding them to a video or walking through the steps with them. Thanks for your understanding!
Ignazio Calo
Courses Plus Student 1,819 PointsThanks Rob, I was really checking for a netiquette here on the Community area. Can you point me into where I can find the Community rules? thanks.
Ignazio Calo
Courses Plus Student 1,819 PointsIgnazio Calo
Courses Plus Student 1,819 Pointsthanks. I totally understand the necessity to block external JS ;) I'll write an email to support team.