MOTOSHARE 🚗🏍️

Rent Bikes & Cars Directly from Owners

Motoshare connects vehicle owners with people who need bikes and cars on rent. Owners earn from idle vehicles, and renters get flexible ride options.

Visit Motoshare

Getting input from users in JavaScript

JavaScript

prompt( ) – The browser provides a built-in function that can be used to get input
from the user, named prompt. The prompt( ) method displays a dialog box that prompts
the visitor for input.

Once the prompt function obtains input from the user, it returns that input.

Syntax: – prompt(text, defaultText)

Ex:- prompt(“Enter Your Name: “, “name”);
prompt(“Enter Your Roll No. : “);

Good Approach

  • Inline
  • External

Inline

External

Good Approach

  • Inside head Tag
  • Inside body Tag

Inside head Tag

Inside body Tag

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x