This article was co-authored by Jessica Andzouana. Jessica Andzouana is a Software Engineer based in the San Francisco Bay Area. With over five years of professional experience in front-end development, digital art, and design, she is passionate about emerging technologies such as blockchain and AI. Her background as both a programmer and artist, paired with a highly design-conscious mindset, provides her a fresh perspective and unique skill set to produce creative solutions in her field. She works at Alcacruz as a Software Engineer, and received a dual BS/BA degree from Santa Clara in Computer Science and Studio Art.
This article has been viewed 132,883 times.
HTML forms are what you need for getting user input. But first, you need to make a text box! Here is a simple tutorial on how to make a text box if you're using Windows.
Steps
Sample Code
Creating a Text Input Using HTML
- Create an HTML page. To do that, open up Notepad or any other plain text editor. On Windows, you can access Notepad via the Start Menu, at: "Accessories", then "Notepad". Or, use the Windows key + R, then type notepad and press enter.
- Put in the code. Write the normal tags (<html><head></head><body></body></html>), and it should look like:Advertisement
- Save the page. Click "File", "Save As", and then save it as test.html. Or, save it as anything.html.
- Open up the window and see your new text box!
- Using JavaScript, now you could make the text box do something in conjunction with a button!
- If you want to put some text before the input box to explain what it is, do so before the <input> tag.
Advertisement
Community Q&A
- QuestionHow do I resize this text box?Community AnswerYou can resize the text box by using CSS. For a good CSS tutorial, you can go to FreeCodeCamp, Codecademy, or W3Schools. However, there are also some very helpful How.com.vn articles.
- QuestionHow do I make a text box mandatory?Vinod KumarCommunity AnswerYou can write required="true" / required="required" instead of required.
Video
Tips
- You can also use other programs, such as Notepad++, PSPad, JEdit, etc. More complex (and expensive) programs such as Dreamweaver are good too.Thanks
- As the video shows, you can set a maximum amount of characters to the box! Just add the maximum length attribute to the input tag. It would look like: maxlength="10".Thanks
- You also want to include an id. Right after name="whatever", put id="whatever". It is recommended to use the same id as the name for ease of use.Thanks
Things You'll Need
- Any text editor
- Browser
Expert Interview
![](https://www.wikihow.com/images/thumb/a/a2/WikiHow-Expert-Interview-Transcript-Jessica-Andzouana_sample.png/340px-WikiHow-Expert-Interview-Transcript-Jessica-Andzouana_sample.png)
Thanks for reading our article! If you’d like to learn more about dealing with html, check out our in-depth interview with Jessica Andzouana.
Is this article up to date?
⚠️ Disclaimer:
Content from Wiki How English language website. Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply.
Wiki How does not encourage the violation of any laws, and cannot be responsible for any violations of such laws, should you link to this domain, or use, reproduce, or republish the information contained herein.
- - A few of these subjects are frequently censored by educational, governmental, corporate, parental and other filtering schemes.
- - Some articles may contain names, images, artworks or descriptions of events that some cultures restrict access to
- - Please note: Wiki How does not give you opinion about the law, or advice about medical. If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.
- - Readers should not judge the importance of topics based on their coverage on Wiki How, nor think a topic is important just because it is the subject of a Wiki article.