DEV Community

yash kumat
yash kumat

Posted on

1 1

3 JS Interactions

1. alert

shows a message.

alert("Hello");

"JavaScript alert"

2. prompt

shows a message asking the user to input text or null.

var name = prompt("What is your name?");

"JavaScript prompt"

Note: You can add an optional second parameter, the initial value for the input field.

var name = prompt("What is your name?", "John");

"JavaScript prompt with default value"

3. confirm

shows a message and waits for the user to press "OK" or "Cancel". It returns "true" for OK and "false" for Cancel.

var confirmation = confirm("Are you sure?");

"JavaScript confirm"

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (0)

Billboard image

Imagine monitoring that's actually built for developers

Join Vercel, CrowdStrike, and thousands of other teams that trust Checkly to streamline monitor creation and configuration with Monitoring as Code.

Start Monitoring

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay