But as soon as I click the Hide button, the page refreshes, and I see the content again (it does get hidden for a fraction of a second, but that's not too helpful).
If you add a <button> element you need to give it a type="button" attribute or it will submit the form.
Code:
<script>
$(document).ready(function(){
$(".my-button").click(function(){
$("p.will-toggle").toggle();});});</script><button type="button"class="my-button">Toggle between hiding and showing the paragraphs</button><p class="will-toggle">This is a paragraph with little content.</p><p class="will-toggle">This is another small paragraph.</p>
Cheers,
Tony Partner Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.