Quantcast
Channel: Internet Explorer Web Development forum
Viewing all articles
Browse latest Browse all 3527

html5 - show hidden text upon loading page

$
0
0
Hi all, 

my need is to show my spoiler upon user's visit. It works fine when user opens link

http://site.com/index.html#show_id5

and he or she can see only visible text, then user can click on spoiler link to see the rest. 

Now I'd like to give users "full link" so he or she can see full text without clicking on spoiler link. 
Please note, that spoiler text should be hidden when user loads http://site.com/index.html link, but it should be visible when user loads somehttp://site.com/index.html#show_id5_clicked link. 

How do I perform it? 

Please find my present code below. 


<p>
<div align="left">
My visible text 
<a id="show_id5" onclick="document.getElementById('spoiler_id5').style.display=''; document.getElementById('show_id5').style.display='none';" class="link"> [unhide]</a><span id="spoiler_id5" style="display: none"><a onclick="document.getElementById('spoiler_id5').style.display='none'; document.getElementById('show_id5').style.display='';" class="link">[hide]</a><br>
<img src="img/mypicture.jpg" alt="picture in spoiler">
</span>
</div> 
</p>

Viewing all articles
Browse latest Browse all 3527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>