Back
How to access an HTML textbox by a javascript function?
You can use ID on text box and use document.getElementById() function like this:
<html><head><script type="text/javascript">function insideTextBox(){ var textBox = document.getElementById('ID'); // do something with it ...}</script></head><body><input type="text" id="ID"></body></html>
<html>
<head>
<script type="text/javascript">
function insideTextBox()
{
var textBox = document.getElementById('ID');
// do something with it ...
}
</script>
</head>
<body>
<input type="text" id="ID">
</body>
</html>
31k questions
32.8k answers
501 comments
693 users