I'm relatively new to javascript, but I searched trough google and stackoverflow for the past several hours and I still can't get this to work, it looks like it's something that should be simple but I'm not sure what I'm overlooking....
I'm trying to make a checkbox to disable my website's onhover tooltips by moving them all away when the checkbox is ticked (since I couldn't apply visibility:hidden; on hover with js), but I can't seem to make the checkbox affect more than a single tooltip.
I'm using GetElementById() which seems to only make use of one element by that id, but I couldn't get GetElementsByClassName() nor GetElementsByName() to work for some reason, even though as far as I can tell from w3schools I should be able to just replace my GetElementById() with the latter two, why does this happen and what should I do instead?
Here's my code: http://jsfiddle.net/wwX3k/1/
function optioninfovisibilitytoggle() {
if (optioninfovisibility.checked) { document.getElementById('optioninfo').style.left='9001%'
} else { document.getElementById('optioninfo').style.left='12%' }
} optioninfovisibilitytoggle();
I need all the tooltips to move aside, by inline id or class or name or whatever, as long as all of them move aside rather than just the top one
Thanks in advance for any help
getElementsByClassNamewith a lower-case "g".