Skip to content Skip to sidebar Skip to footer

Change Textbox Value In Javascript

I want to update the value of text box from where I'm getting initial value to add product to cart. Now I'm applying round function & I want to update the value of text box tha

Solution 1:

Have you tried

$('.quo_'+productid).val(quantity);

The jQuery selector returns a wrapped object, not the actual DOM element. I don't think wrapped object has the .value property

Solution 2:

you are almost correct the only thing why it is not working because your syntax is wrong

this is the correct syntax for jQuery

$('.quo_'+productid).val(quantity);

if you want it in javascript

var txt = document.getElementById("quo_"+productid);
txt.value = quantity;

Post a Comment for "Change Textbox Value In Javascript"