Home › Forums › JavaScript › how to dynamically hide or reveal tables rows as needed › Reply To: how to dynamically hide or reveal tables rows as needed
May 6, 2014 at 2:37 am
#169310
Stuart Bennett
Participant
<script type="text/javascript">
/*
https://css-tricks.com/forums/topic/how-to-dynamically-hide-or-reveal-tables-rows-as-needed/#post-169277
*/
var $ourServices = $('#subject'),
$webDesign = $('#website'),
$webHosting = $('#hosting'),
$whichPlatform = $('#whichplatform'),
$hiddenBoxes = $('#website, #hosting, #whichplatform');
$hiddenBoxes.hide();
$subject.change(function(){
var $d = $(this).val();
switch ($d) {
case 'Website Design Enquiry':
$hiddenBoxes.hide();
$website.fadeIn();
break;
case 'Website Hosting Enquiry':
$hiddenBoxes.hide();
$hosting.fadeIn();
break;
case 'Mobile App Development Enquiry':
$hiddenBoxes.hide();
$whichplatform.fadeIn();
break;
default:
$hiddenBoxes.hide();
break;
}
});
</script>
thats the js i am using.