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:
<style type="text/css">
#nav-ask{ display:none; }
</style>
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.
.nav ul li a#nav-ask{
display:none;
}
I found that the following code, when inserted into the site's footer, worked well enough:
<script type="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...
@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
<style type="text/css">
#nav-ask{ display:none; }
</style>
or if you already have a "hideMe" CSS Class:
<script type="text/javascript">
if(document.getElementById && document.createTextNode)
{
if(document.getElementById('nav-ask'))
{
document.getElementById('nav-ask').className='hideMe';
}
}
</script>
you can use CSS selectors
a[href="/questions/ask"] { display:none; }