How to create a dialog box with CSS and Javascript? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to create a dialog box with CSS and Javascript?

I want to create a dialog box that will open on button click but i want to apply some css to it.How can i do it?

12th Jun 2018, 2:35 AM
vishal rajput
vishal rajput - avatar
3 Answers
12th Jun 2018, 6:41 AM
Igor Makarsky
Igor Makarsky - avatar
0
crete a div with the whole box in html and 'style="display:none"' and in javascript you toggle the display attribute if the button is clicked. you can call the function with the onclick attribut in html
12th Jun 2018, 7:29 AM
Lexfuturorum
Lexfuturorum - avatar
0
thanks
14th Jun 2018, 11:26 PM
Stevvictory Chidubem Azubuike
Stevvictory Chidubem Azubuike - avatar