---
title: "Discussion on \"User input in JavaScript\" | Hashnode"
description: "Discussion on \"User input in JavaScript\". To receive user input in JavaScript, you can use the prompt() function or interact with HTML elements. Here's an example of both approaches:\n\nUsing prompt():\n\nlet userInput = prompt(\"Please enter your name:\");\nconsole.log(\"Hello, \" + userInput + \"!\")..."
url: "https://hashnode.com/posts/user-input-in-javascript/64bfc9b56fa62b7303d743f0"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [User input in JavaScript](https://indracit.hashnode.dev/user-input-in-javascript?utm_source=hashnode&utm_medium=feed)

To receive user input in JavaScript, you can use the prompt() function or interact with HTML elements. Here's an example of both approaches: Using prompt(): let userInput = prompt("Please enter your name:"); console.log("Hello, " + userInput + "!")...

Jul 25, 2023 · 1 min read · indracit.hashnode.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)

## Written by

[Indracit S](https://hashnode.com/@indrajithij98)

@indrajithij98 · Chennai, India

  
[View profile](https://hashnode.com/@indrajithij98)

Software Engineer

Software Engineer | JavaScript, React, Redux, Node JS, Express, MongoDB

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
