Hello, in this JavaScript video, I am going to show you the prompt box. So this is a method for getting some information from the user inside of using the actual HTML web page itself. And we are going to assign it to a variable. So let's create a variable first author. And to do this, you just put, like So next, you just need to put quotation marks in here, you specify essentially, what you're, you know, what you want to say, enter your name. And then optional parameter here as well.
So this is you know, something that is called a method a function. And we are calling this and this has, you know, functionality Code Authority built into JavaScript and it will perform some sort of function for us. And we will be creating all of our own functions and methods later on. So don't worry about A prompt agent, something they can provide to it. And he can do something with it. Again, we'll cover that and I reload, it pops up.
So please enter your name. And if I put my name you know, we don't do anything with it yet. So this is the console. So console dot log. So the console that and we could literally use this, I mean, this variable anywhere we want, we could assign stuff to it. So replace it as we would in any other situation with variables.
One last thing before combat, this optional parameter of quotation marks again, will actually specify a default value for the process and that's already there for Batman in, save that, reload authority. Save that, press OK. It comes down. Reload, instead of change it to blob, click OK. It gets that value. So you can put a default value like this.
And that's it for the prompt. Really simple, really easy. Thanks for watching. If you have any questions, as usual, drop me a message the GitHub link will be available as well. We will know the source code and I look forward to seeing you in the next video.