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>
Romsons Poochie Play Pants Baby Diapers - S (1 Piece) | Suitable for 3-8 KG | 360° Comfort Fit and Leakproof Upto 10 Hrs.
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.)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.)Mee Mee Baby Liquid Detergent 1 L | pH Balanced, Free from Harsh Chemicals, Safe for Mother’s Hands & Baby’s Skin | Anti-Bacterial, Removes Stains & Odor with One Drop, Hypoallergenic | Mild Scent
₹229.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.)1st Step Socket Protectors for Baby & Kids | Pack Of 12 (6 A X 9 pcs And 16 A X 3 pcs) | Child Safety Proof Electrical Socket Covers for Switch Board| Easy to Install & Remove | Dummy Plug Cover Guards for Kids Safety |Baby Proofing Safety Accessories
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.)