I'm sure you'll see many different variations for this but here's what I use
Code:
<div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px; width:852; height:26"><right><font color="red"><b> </b></font></right>
<input type="button" value="Spoiler" style="font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Spoiler'; }">
</div>
<div>
<div style="display: none;">
{param}
</div>
</div>
</div>
Works just fine on mobile....
Edit: didn't look at the entire code but it looks exact same almost but I have no issues on either vb3 or vb4 forum on mobile.