How to make an ā€œif button is pressed do thisā€ | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 5

How to make an ā€œif button is pressed do thisā€

I want to make that when you press a button everything fadeOut and appear other Things like codes or images but if not stay my first codes. Two people explain me but I donā€™t understand. Please explain me with too much detail or senda me a YouTube link.

9th Mar 2018, 9:46 PM
Octavio Aguayo
Octavio Aguayo - avatar
3 Respostas
+ 8
@Jayden LeCorps Yeah, but what about without html ( onclick="" ... ) ? Ps: Are you french ? ^^
10th Mar 2018, 11:44 PM
Chalza
Chalza - avatar
0
<button id="burrito">Burrito!</button> <script> function burrito_machine(){alert("BURRITO FOR THE VICTORY");} button1 = document.body.getElementById("burrito"); button1.onclick = burrito_machine();</script>
17th Mar 2018, 2:11 PM
Arda Aydın
Arda Aydın - avatar
0
there u go @VapeHorization
17th Mar 2018, 2:11 PM
Arda Aydın
Arda Aydın - avatar