In my case, jQuery is not working. I don't know where I am wrong. It can be confliction with some other js files but not sure. See below screenshot.
In this screen shot you are seeing google custom search box which is ajax based. My problem is when i click on search box then bottom Premium sales jobs contaner should be hidden. For this i have used this jQuery code :
$(document).ready(function(){
$(".gsc-search-button").click(function(){
$("#container_table").hide();
});
)};
I have included jQuery library with correct path. I have also used alert()
after document.ready
to check it is working or not..But its not working.
.gsc-search-button is the class of search button.
#container_table is the id of that table which I want to hide.
The search data will be load into like div which is initially look like this :
<div id="cse">Loading</div>
and after search iframe
placed into this div and replaced Loading String.
I have also tried below javascript code :
if(document.getElementById('cse').innerHTML != "Loading") {
document.getElementById('#container_table').style.display = "none";
}
But it'开发者_StackOverflow中文版s not working.
You're confusing the CSS style selectors in jQuery with the ID in the following code:
document.getElementById('#container_table')
It might work if you remove the '#' symbol:
document.getElementById('container_table')
But another way that would clear the element with "cse" identity would be
$('#cse').text('')
精彩评论