Show hidden text

Hello,
I have this code with 2 buttons to show and hide text. But i want only to show the hidden text using only 1 button.
Can anyone help me ?

<p id=“p1”>Text text text…text .</p>

<input type=“button” value=“Hide text” onclick=“document.getElementById(‘p1’).style.visibility=‘hidden’” />
<input type=“button” value=“Show show” onclick=“document.getElementById(‘p1’).style.visibility=‘visible’” />

as far as i know it cannot be done with css.

you will need to use javascript for this effect.

ask the mods to shift your thread in that section.

vineet

Yes you are going to need a Javascript function that tests the visibility property of the element and if it is hidden show it, if visible hide it.

Simply function though

Thank you…