I'm trying to simulate a keyboard event in Safari using JavaScript.  I have tried this:  var event = document.createEvent("KeyboardEvent"); event.initKeyboardEvent("keypress", true, true, null, false, false, false, false, 115, 0...
I have a form with two text boxes, one select drop down and one radio button. When the enter key is pressed, I want to call a Javascript function (User defined), but when I press it, the form is submitted.   How do I prevent the form from being sub...
Please note that Object.Watch and Object.Observe are both deprecated now (as of Jun 2018).    I was looking for an easy way to monitor an object or variable for changes, and I found Object.watch(), that's supported in Mozilla browsers, but not...
Is there any way to trigger event (may be custom) on attribute change?   Let's say, when IMG src is changed or DIV's innerHtml?...
If I for example have   <p> some long text </p>   on my HTML page, how can I know that cursor of mouse is for example above the word 'text'?...
Is possible to add event listener (Javascript) to all dynamically generated elements? I'm not the owner of the page, so I cannot add a listener in a static way.  For all the elements created when the page loaded I use:  doc.body.addEventListene...
I have an input form that lets me select from multiple options, and do something when the user changes the selection. Eg,  <select onChange="javascript:doSomething();">   <option>A</option>   <option>B</option>...
Is it possible to get the mouse position with JavaScript after page loads without any mouse movement event (without moving the mouse)?...
I'm writing a Greasemonkey script for a site which at some point modifies location.href.  How can I get an event (via window.addEventListener or something similar) when window.location.href changes on a page? I also need access to the DOM of th...
The following doesn't work... (at least not in Firefox: document.getElementById('linkid').click() is not a function)  <script type="text/javascript">     function doOnClick() {         document.getElementById('linkid&#...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.