JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<!-- value 에 값이 들어가는 순간의 caller 찾기 -->
<input type="text" name="asdf">
JavaScript
var descriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');
descriptor.set = function() {
console.log('this =>', this);
console.log('event => ', event || window.event);
console.log('this.caller => ', arguments.callee ? arguments.callee.caller : '');
return this.textContent = arguments[0];
}
Object.defineProperty(HTMLInputElement.prototype, 'value', descriptor);
function calling() {
$('[name=asdf]')[0].value = 'zxcv';
}
$(function() {
calling();
});