---
title: "How to get the contents of an input box using JavaScript?"  
description: "How to get the contents of an input box using JavaScript?"  
author: "Amit Singh"  
published: 2011-03-18  
updated: 2020-09-18  
canonical: https://www.mindstick.com/interview/522/how-to-get-the-contents-of-an-input-box-using-javascript  
category: "javascript"  
tags: ["javascript"]  
reading_time: 1 minute  

---

# How to get the contents of an input box using JavaScript?

Use the "value" property.\
var myValue = window.document.getElementById("MyTextBox").value;

## Answers

### Answer by Amit Singh

Use the "value" property.\
var myValue = window.document.getElementById("MyTextBox").value;


---

Original Source: https://www.mindstick.com/interview/522/how-to-get-the-contents-of-an-input-box-using-javascript

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
