I'm trying to get this basic jquery function to work so I can use the same idea on a bigger part of a site I'm working on right now. Been looking through the code for an hour right now and I checked the jquery documentation to make sure I got the selectors all in the right place, and I've used the right selectors.
I just don't know how to fix it so when I click the button, the panel's font color changes.
https://jsfiddle.net/p28jjo2u/
<div class="col-xs-3">
<div id="panel4" class="panel panel-primary">
<div class="panel-heading panel4">
#panel4
</div>
</div>
</div>
<a class="btn btn-default" id="button" href="#" role="button">Link</a>
css
#button {
outline: none;
}
#panel4 .panel4 {
color: white;
}
jquery
//playing around with panels and buttons in schedule tab
$(document).ready(function(){
$('#button').on('click', function() {
$('#panel4').find('.panel4').css({
'color': 'red';
});
});
});