I'm trying to find the cause of an unwanted value modification so I can remove the bug. When I turn off javascript for my page it includes this element after loading:
<input type="hidden" value="5123" name="report[sub_district_id]" id="report_sub_district_id">
but when I have javascript on, the same element looks like this after page load:
<input type="hidden" value="" name="report[sub_district_id]" id="report_sub_district_id">
I can't work out what code is unsetting the value property.
I've got one method that I know of that modifies the value. I've tried putting an alert in that method, but it's not triggered. I've also tried commenting out that method, but still the change happens. Perhaps some of my other JS accidentally hooks onto this element, but it seems unlikely. Perhaps the change is caused by some code in my framework (Rails with Materialize).
I've also tried adding DOM breakpoints "attribute modified" and "subtree modified" on this element, and "subtree modified" on the parent element, but none of these breakpoints are triggered.
The "attribute modified" breakpoint does trigger when my code modifies the value of the input at some point after the page is loaded, but I'm trying to find what is happening when "page:change" event is triggered, and this breakpoint is not triggering - perhaps because the DOM is not loaded yet.
I've tried the answers to this question but they don't help because they don't show how to make a breakpoint on an element change event that triggers before the DOM is loaded.
I'm using Chromium browser 48.0.2564.116 on Ubuntu 15.10 (64-bit)
How can I find what the cause of this bug is?