How to track exact event handler of HTML element, if it is not registered with the element?
I am using some third party control in my aspx form. The control renders into the following HTML code:
<input type="text" style="height: 20px; text-align: right;" class="edit" id="numberBox" />
Now at the time I press any key in this input text field, 开发者_运维技巧event fires but those events are not registered here with element perhaps the events are registered by the control somewhere else in the JavaScript files that are registered along with this control.
My question is how to track that exact event handler, is there any tool for it to see all the associated events of that particular element.
Try to do this
alert(document.getElementById("numberBox").onkeypress)
. See if you can see the source code of the onkeypress event. If it is null, it means no event is registered to the onkeypress event.
You can write a for in loop to show all the members (including the event) of an object with javascript.
精彩评论