You can easily get textbox or form elements value using javascript. You can use one of the the following method to get the textbox value
- document.getElementById
- document.getElmentsByTagName
- document.getElementsByName
- document.getElementsByClassName
- document.reg_frm.fname //where reg_frm is your form name; fname is your textbox name
Example:
<!DOCTYPE html>
<html>
<body>
<form name="reg_frm">
First Name: <input type="text" name="fname" class="myclass" id="myText" value="CODEFORBEGINNER">
<p>Click the button to display the value of the value attribute of the text field.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
</form>
<script>
function myFunction() {
//use any one method to get output
var x = document.getElementById("myText").value;
var x = document.getElementsByName("fname")[0].value;
var x = document.getElementsByTagName("input")[0].value;
var x = document.getElementsByClassName("myclass")[0].value;
var x = document.reg_frm.fname.value;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>
Pampers Active Baby Tape Style Baby Diapers, Newborn/Extra Small (NB/XS) Size, 72 Count, Adjustable Fit with 5 star skin protection, Up to 5kg Diapers
₹1,009.00 (as of November 10, 2026 01:36 GMT +05:30 - More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Mamypoko pants Standard| Pant Style Baby Diapers X- Large Size(XL), 64 Count, Ideal for 12-17Kgs|Crisscross absorption 10hr protection from leakage
₹649.35 (as of November 10, 2026 01:36 GMT +05:30 - More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Ghar Soaps Magic Baby Bar | For Glowing Baby skin | With Ubtan + Malai + Kesar | pH 5.5 & dermatalogically tested (75gm x 3 Pack)
Now retrieving the price.
(as of November 10, 2026 01:36 GMT +05:30 - More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)