I have a situation where these 3 things are simultaneously true. What's going on?
This is the element in the dom:
<input id="destroy_vehicle_section_4" name="driver[workables_attributes][0][_destroy]" type="text" value="1">
After changing the attribute value with JQuery's val method (or javascript's getElementById().value), using the console:
> $("#destroy_vehicle_section_4").val()
<- "test"
...The DOM remains the same.
I can also change the value with JQuery's attr method,
> $("#destroy_vehicle_section_4").attr("value")
<- "hey"
The DOM remains the same, and the 2nd call also still show "test"
How is this possible?
It's meaning that my attempts to change the input using jQuery are failing.
N.B: Am using jQuery Mobile.
EDIT:
Sorry for the poor explanation. I first set using attr("value", "hey") and val("test"), neither console call changed the DOM element. However if you run the "Getter" lines in the console, you get the above