I am trying to use jQuery to fill in a form with some default values.
The form is contained in a div which has an id. In fact every element has an id, I did so just t
You can use the val() function to set input values
$("#coordX_0").val(123);
Incidentally, your original code could be made to work by setting value property on the actual, underlying dom element. You access the dom element by indexing your jQuery results:
$("#coordX_0")[0].value = 123;
Just write:
$("#coordX_0").val(123);
In jQuery
, text
is a function to extract text in dom.
$("#coordX_0").val("123");
You need the quotes too I think. Although it might work both ways.