Home >Web Front-end >JS Tutorial >Js in bits - nteraction)

Js in bits - nteraction)

Mary-Kate Olsen
Mary-Kate OlsenOriginal
2024-12-30 08:36:39181browse

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

Js in bits - nteraction)

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.

Js in bits - nteraction)

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

Js in bits - nteraction)

Leave y'r thoughts....

The above is the detailed content of Js in bits - nteraction). For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn