Skip to content

Tag: html

Stop form refreshing page on submit

How would I go about preventing the page from refreshing when pressing the send button without any data in the fields? The validation is setup working fine, all fields go red but then the page is immediately refreshed. My knowledge of JS is relatively basic. In particular I think the processForm() function at…

How to pass an array from HTML to Javascript?

I have a form which has multiple <select> drop-down boxes. I wish to pass the value in these drop-down boxes as an array to a JavaScript function. Currently my code is like: Where all_films is a variable from Django framework (Most probably you need not concern yourself with it). What I want to do is th…

Firefox div > svg mouseover fires OUTSIDE div

I have a div with two svg-elements inside, which are shown/hidden when hovering with the mouse. The mouseover event is registered with the div. On Chrome and Safari it works, on FF the SVG sits at a different position and the “hitbox” of the div where I can hover, is very large, like 3 times the a…

HTML5 event for `onselectionchange`

Is there a standard cross-browser HTML5 event which corresponds to IE legacy onselectionchange (so it is fired when the current selection changes)? EDITED, I’m looking to track Selection object changes. Answer use onchange I recommend using jQuery to avoid these cross browser issues, but that does not m…