Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Javascript DOM help
I want this label to be invisible
this should work. but it isn't
How do I add the !important string next to none, because its being owerwritten
<label class="Radio" for="Radio_FCKeditor">Toolbar</label>
this should work. but it isn't
var elems = document.getElementsByTagName("label") ;
for (var i = 0; i < elems.length; i++) {
if (elems[i].attributes["for"].value == "Radio_FCKeditor") {
elems[i].style.display = "none";
}
}
How do I add the !important string next to none, because its being owerwritten
0
This discussion has been closed.
Comments
document.getElementById('your_id').style.display = 'none';
I used visibility:hidden instead
if (elems[i].attributes["htmlFor"].value == "Radio_FCKeditor") {
'for', 'style' and 'class' attributes have a special name in the html DOM: 'htmlFor', 'cssText' and 'className'.do u know of a way to make the style.display = none take precedence. Now now its being overwritten by vanilla css. So i used visibility :hidden instead.
Here is what I use to hide elements:
/** * Hide on element. * @param {DOMelement} elem Element to hide */ hide = function(elem){ if(elem.style && typeof(elem.style.display) !== 'undefined'){ elem.$oldDisplay = elem.style.display; // Saved the display for later use. John Resig, 2006. elem.style.display = 'none'; } }; /** * Show a hidden element. * @param {DOMelement} elem Element to show */ show = function(elem){ if(elem.style && typeof(elem.style.display) !== 'undefined'){ elem.style.display = elem.$oldDisplay || ''; } };