Reputation: 113
I currently have this code
<script>
$('well').click(function () {
$('span').css('background-color', '#000').css('color', '#000');
});
</script>
and I'm trying to make when I click on this "well" (from bootstrap) the color to a span from this well to be changed..
Upvotes: 1
Views: 475
Reputation: 805
if well
is class than use .well
$('.well').click(function () {
$('span').css({backgroundColor:'#000', color:'#000'});
});
if well
is id than use #well
$('#well').click(function () {
$('span').css({backgroundColor:'#000', color:'#000'});
});
Also make sure to wrap your code in DOM ready:
jQuery(function( $ ) { // DOM is now read and ready to be manipulated and $ alias secured
// Your $ jQuery code here
});
Upvotes: 3