We're looking into Zendesk for our support site but it's not very customizable. I'm trying to remove specific text from the page using their widgets function (which can be created in javascript or css).
I'm trying to hide the following h2 tag while displaying the page:
<h2 id="search_box">Knowledge Base & Forums</h2>
I've tried the following CSS:
.search_box {
display: none;
}
But it doesn't seem to work. I'm not great with either CSS or javascript and I also don't know exactly when these widgets run, but I assume I'm doing something wrong in terms of accessing the element on the page.
I've been able to hide the text using the following bination of Javascript and CSS codes, but it doesn't do what I need because it will hide any part of the page that has the text in it:
Javascript:
$j('h2:contains(Knowledge Base & Forums)').addClass('forumtitle');
CSS:
.forumtitle {
display: none;
}
Thanks for any help!
We're looking into Zendesk for our support site but it's not very customizable. I'm trying to remove specific text from the page using their widgets function (which can be created in javascript or css).
I'm trying to hide the following h2 tag while displaying the page:
<h2 id="search_box">Knowledge Base & Forums</h2>
I've tried the following CSS:
.search_box {
display: none;
}
But it doesn't seem to work. I'm not great with either CSS or javascript and I also don't know exactly when these widgets run, but I assume I'm doing something wrong in terms of accessing the element on the page.
I've been able to hide the text using the following bination of Javascript and CSS codes, but it doesn't do what I need because it will hide any part of the page that has the text in it:
Javascript:
$j('h2:contains(Knowledge Base & Forums)').addClass('forumtitle');
CSS:
.forumtitle {
display: none;
}
Thanks for any help!
Share Improve this question edited Mar 30, 2011 at 17:40 Charles 51.4k13 gold badges106 silver badges144 bronze badges asked Feb 18, 2011 at 4:28 mjdthmjdth 6,5466 gold badges40 silver badges44 bronze badges 05 Answers
Reset to default 5#search_box {
display: none;
}
. is for classes, # is for ids
Try using in your CSS:
#search_box {
display: none;
}
If you wish to use jQuery you can try this...
$(document).ready(function(){
$("h2").each(function(){
if(trim($(this).html()) == "Knowledge Base & Forums") {
$(this).hide();
}
});
});
Your CSS is off - to hide an id `search_box your CSS would be
#search_box {
display: none;
}
Note the # for id - . is for classes.
Try document.getElementByID("search_box").style.visibility = 'hidden';
in Javascript