Ok, i'm trying to make some kind of spoiler tag for my blog. I can only use javascript.
I thougt I'd use a div with the class spoiler and then a link to make these classes visible or invisible.
Only problem I can't get it working
What I have now is this:
css:
code:
.spoiler{
visibility:hidden;
}
javascript:
code:
function spoiler(){
'if(document.getElementById(spoiler).style.display = 'hide'){
document.getElementById(spoiler).style.display = 'block';
'else{
'document.getelementbyid(spoiler).style.display = 'hide';
}
}
html link:
code:
<a href="#" onClick="spoiler()">Spoilers (on/off)</a>
Oh, and I want it easy cause I have almost no experience with javascript
Can please somone help me?