Hide Html Element By Id
Hopefully there's a quick and dirty way to remove the 'Ask Question' (or hide it) from a page where I can only add CSS and Javascript:
Solution 1:
If you want to do it via javascript rather than CSS you can use:
var link = document.getElementById('nav-ask');
link.style.display = 'none'; //or
link.style.visibility = 'hidden';
depending on what you want to do.
Solution 2:
<styletype="text/css">#nav-ask{ display:none; }
</style>
Solution 3:
@Adam Davis, the code you entered is actually a jQuery call. If you already have the library loaded, that works just fine, otherwise you will need to append the CSS
<styletype="text/css">#nav-ask{ display:none; }
</style>
or if you already have a "hideMe" CSS Class:
<scripttype="text/javascript">if(document.getElementById && document.createTextNode)
{
if(document.getElementById('nav-ask'))
{
document.getElementById('nav-ask').className='hideMe';
}
}
</script>
Solution 4:
.navullia#nav-ask{
display:none;
}
Solution 5:
I found that the following code, when inserted into the site's footer, worked well enough:
<scripttype="text/javascript">
$("#nav-ask").remove();
</script>
This may or may not require jquery. The site I'm editing has jquery, but unfortunately I'm no javascripter, so I only have a limited knowledge of what's going on here, and the requirements of this code snippet...
Post a Comment for "Hide Html Element By Id"