I'm new at a company with a web app featuring many millions of SLOC.
For some reason, when clicking on a textarea (in any browser), an associated radio button is de-selected.
I'm not sure what JavaScript is being triggered by the textarea onclick
, and I'm started to wonder if unobtrusive code, while encapsulating code that is not directly related to the mark up, makes it overbearing to hunt down and break into critical sections of the source.
Is there a way using the Chrome developer console to break into the JavaScript that is deselecting the radio button? I've tried a couple options to no avail :(
Bonus: Is this a downside to unobtrusive JavaScript?
EDIT: Here is the HTML:
<div class='radio'>
<label data-toggle='tooltip' title='Originated somewhere else.'>
<input type='radio' id='q2023_r2320' name='q2023' value='2320' Other />*Other</label>
<br />
<textarea id='q2023_r2320_text' name='q2023_r2320_text' style='width:80%;' rows='1' class='form-control'>
</textarea>
</div>
You can add a change event handler to the radio button, add a breakpoint inside there, when it gets hit look at the stack trace. Also, try doing a Ctrl-Shift-F in the Sources tab inside chrome dev tools and search for relevant hooks, such as the 'radio' and 'form-control' classes.