How to Display a Javascript Variable in a Textbox

Next Video:
Tutorial for Connecting to MySQL With JavaScript....5

Displaying a Javascript variable in a text box will require the careful use of the right code. Display a Javascript variable in a text box with help from a self-taught web developer in this free video clip.

Part of the Video Series: Web Programming
Promoted By Zergnet


Video Transcript

Hi, I'm Christina Chiu. I'm a Computer and Web Specialist and today, I'm going to show you how to display a javascript variable in a text box. So, we open our text header here that's in our HTML document, we have the text box of input. So, type equals text id equals my text. So, we're going to incorporate little javascript; so, it will be within the head right here, we're just going to type in script type equals text slash javascript slash script. So, we create a, a javascript variable so it would bar test equals hello and then document get element by id and id is mytext; so, mytext and then the value of mytext will be test. So, that is how you make a javascript variable appear in a text box. Thanks so much for your time, my name is Christina Chiu.


Related Searches

Is DIY in your DNA? Become part of our maker community.
Submit Your Work!