Later, with the help of the great Baidu, I finally found the cause of the problem:
$("") is a jquery object, not a dom element
value is an attribute of dom element
jquery corresponds to val
val(): Get the first matching element current value.
val(val): Set the value of each matching element.
So, the code should be written like this:
Value: val = $("#id")[0].value;
Assignment:
$("#id")[0].value = "new value";
Or $("#id").val("new value");
Or this also works: val = $("#id").attr("value");