0

I have an input field

<input id='target' type='text'>

and I would like to modify its value with javascript. Normally, this would be as easy as doing

document.getElementById('target').value = 'new value';

However, this input field is embedded into a page that loads other scripts that could potentially interact with this field and make changes as well.

How can I find out all the scripts that change the value of this input without spelunking through all the code. Is there some way to set a listener on the input field that logs all attempts to modify it?

takinola
  • 1,643
  • 1
  • 12
  • 23
  • Not really. The answers to that question only pertain to elements that are bound by jQuery. In my case, there could be vanilla javascript code responsible for the changes – takinola Feb 07 '18 at 21:08
  • There are answers to that question that do not rely on jQuery. For example, see the second answer in the link I referred to above. – devlin carnate Feb 07 '18 at 21:12

0 Answers0