0
Can you guys write me a very basic javascript code?
I need a js code that will set p' s visibility value (css) to visible when they click a button that has the class of "button"?
1 Answer
+ 8
HTML :
<p>Hello</p>
<button onclick="show()" id=btn>Show</button>
CSS :
p {visibility: hidden}
JS :
function show() {
document.getElementsByTagName("p")[0].style.visibility = visible
}