JS Help 2 | SoloLearn: Learn to code for FREE!

0

JS Help 2

How can I make a button when pressed make new buttons appear. (the new button are pre-made but invisible)

12/20/2017 6:25:36 AM

JOHNTHEBUN

5 Answers

New Answer

+24

<html> <head> <title>JavaScript A-Z Practicals</title> <style> h1{ color:red; text-align:center; background:-webkit-linear-gradient(blue , cyan , #00F318 , cyan , blue); } button { color:red; font-weight:bolder; padding:10px; margin:10px 0 10px 30%; } pre{ color:#00F318; } </style> <script> function show_code() { x = document.getElementById("show_js_code"); if(x.style.display=="block"){ x.style.display="none"; } else{ x.style.display="block";} } </script> </head> <body bgcolor="black"> <h1>If & Else</h1> <button onclick="show_code()">Show Code</button> <br/> <pre id="show_js_code"> if( b_tags.style.display=="block"){ b_tags.style.display="none"; } else{<br/> b_tags.style.display="block";} </pre> </html> try this code 100% Working

+8

you can change the css with js yourButton.style.display = "block"; yourButton.style.display = "none";

+6

<input type="button" value="click me" onclick="myFunction()" />

0

https://code.sololearn.com/WHS8voelyFq6/?ref=app

-1

im asking how can i make a button appear