html conditional button | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

html conditional button

how can we create a button that when we click on it create another button for me on the page like plus sign in some panels whom you can create a new directory for a new table or project

15th Feb 2018, 1:00 PM
hossein hayati
hossein hayati - avatar
1 Resposta
+ 1
You can use event listner to your first button ex ā€œonclickā€ myFun() When you click the button this calls the function myFun() In myFun() first remove that button (hope you know how to remove using parentChild.removeElement()) After that creates a new button (createElement) , set id using setAttribute() Method. Thats It, once id is set you can do whatever you want to do work with this button
15th Feb 2018, 1:13 PM
Faisal Khan
Faisal Khan - avatar