---
title: "How to hide the contents of the tab"  
description: "How to hide the contents of the tab"  
author: "Anonymous User"  
published: 2013-03-05  
updated: 2013-03-05  
canonical: https://www.mindstick.com/forum/622/how-to-hide-the-contents-of-the-tab  
category: "javascript"  
tags: ["javascript"]  
reading_time: 2 minutes  

---

# How to hide the contents of the tab

Hi Everyone!

I have 4 tabs, each tab contains different data. When I click on the [checkbox](https://www.mindstick.com/articles/291/how-should-use-checkbox-control-in-vb-dot-net), the corresponding tab is shown.But when I uncheck, the tab is invisible but

the contents are not invisible. How to [solve this problem](https://answers.mindstick.com/qa/94681/my-google-assistant-shows-completely-different-search-results-from-what-i-ask-how-can-i-solve-this-problem)? My page is

<[style](https://www.mindstick.com/articles/126300/apa-citation-style-get-to-know-about-it-for-your-next-assignment)>\
.ui-state-disabled {\
display: none;\
}\
</style>\
<[script](https://www.mindstick.com/interview/477/how-can-i-execute-a-php-script-using-command-line)>\
$([function](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server)() {\
$("#tabs").tabs();\
$("#tabs").tabs("[option](https://www.mindstick.com/forum/159391/jquery-get-selected-option-from-dropdown)", {\
"selected": 2,\
"disabled": [1,2,3]\
});

$( "input[type=checkbox]" ).click(function(){\
if ($(this).is(':checked')) {\
$('#tabs').tabs("enable", $(this).val());\
$('#tabs').tabs("[select](https://www.mindstick.com/forum/160534/orderby-then-select-vs-select-then-orderby-performance)", $(this).val() );\
}\
else{\
$('#tabs').tabs("[disable](https://www.mindstick.com/forum/12901/how-to-disable-enable-input-box-in-aspx-with-value-from-sql)", $(this).val());\
}\
});\
});\
</script>\
.

<body>\
<div id="tabs">\
<ul>\
<li><a href="#tabs-1">Nithin</a> </li>\
<li><a href="#tabs-2">Vipin</a></li>\
<li><a href="#tabs-3">Sachin</a></li>\
<li><a href="#tabs-4">Ganguly</a></li>\
</ul>\
<div id="tabs-1">\
<p>Nithin</p>\
</div>\
<div id="tabs-2">\
<p>Vipin</p>\
</div>\
<div id="tabs-3">\
<p>Sachin</p>\
</div>\
<div id="tabs-4">\
<p>Ganguly</p>\
</div>\
</div>\
<input type="checkbox" name="tabs-1" value="1">tabs-1 \
<input type="checkbox" name="tabs-2" value="2">tabs-2 \
<input type="checkbox" name="tabs-3" value="3">tabs-3 \
<input type="checkbox" name="tabs-4" value="4">tabs-4 \
</body>\
</html>

Thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)!

## Replies

### Reply by AVADHESH PATEL

Hi Ezra!

Try this JQuery!\
$(function() {\
$("#tabs").tabs();\
$("#tabs").tabs("option", {\
"selected": 0,\
"disabled": [1,2,3]\
});

$( "input[type=checkbox]" ).click(function(){\
if ($(this).is(':checked')) {\
$('#tabs').tabs("enable", $(this).val());\
$('#tabs').tabs("select", $(this).val() );\
}\
else{\
$('#tabs').tabs("disable", $(this).val());\
var tab = $(this);\
$('#tabs').tabs("select", $(":checked").first().val());\
//$('#tabs').tabs("select", $(":checked").last().val());\
//It is based on you what to use. (first or last selected value)\
}\
});\
});


---

Original Source: https://www.mindstick.com/forum/622/how-to-hide-the-contents-of-the-tab

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
