DEV Community

Avinashd
Avinashd

Posted on

Js in bits - 6(Interaction)

Learning js should be fun. It is fun if it's easy.
I tried my best in writing this, to understand it the easy way.

Interaction
There are 3 default interactions provided by js. All 3 of them are modals.
If any of them are triggered, it will stop the interactivity on the rest of the page.

alert
Gives some statement with ok button

Image description

prompt
A question with input to add the answer & ok button
An optional parameter can be given, with the question.

input given by user will always be in a string format.

Image description

confirm
Some statement with cancel & ok buttons.
ok -> true, cancel -> false

Image description

Leave y'r thoughts....

Top comments (0)