Click here to Skip to main content
11,716,938 members (81,815 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: Javascript HTML email
Hi guys,

I wanna ask on how to create spoiler in email. I use mozilla thunderbird.
Here's the code i've tried :
<div id="spoiler" style="display:none"> 
Spoiler Content Here
<button title="Click to show/hide content" type="button" onclick="if(document.getElementById('spoiler').style.display=='none') {document.getElementById('spoiler').style.display=''}else{document.getElementById('spoiler').style.display='none'}">Show/hide</button>

Well, the result : button is good, but when i clicked the button nothing happened.
Is there anything wrong with my code?

many thanks
Posted 28-Nov-12 15:27pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1


Is a simple code that would do the trick.
satrio_budidharmawan at 2-Dec-12 22:39pm
well, i've tried it, but same result with my previous codes.
I suspected something wrong with Thunderbird since i've tried it with gmail and it worked.
TorstenH. at 3-Dec-12 5:37am
might be that Thunderbird does not use JS there. Or is it restricted to the internet settings on MS? Might be switched off there.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 659
1 F-ES Sitecore 260
2 Maciej Los 185
3 OriginalGriff 175
4 Richard MacCutchan 140
0 Sergey Alexandrovich Kryukov 1,029
1 Maciej Los 464
2 Richard MacCutchan 430
3 CHill60 415
4 OriginalGriff 415

Advertise | Privacy | Mobile
Web01 | 2.8.150901.1 | Last Updated 29 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100