Click here to Skip to main content
11,790,021 members (54,180 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 OriginalGriff 1,029
1 Maciej Los 790
2 KrunalRohit 686
3 CPallini 606
4 Richard MacCutchan 460

Advertise | Privacy | Mobile
Web02 | 2.8.1509028.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