None of my JS runs if I have multiple jQuery events in my $(document).ready()

jquery

#1

`$(document).ready(function() {
$('#start').click(function() {
$('#start').hide();
$('#choose-shale').css({
visibility: 'visible'
});
$('#choose-basalt').css({
visibility: 'visible'
});
$('#choose-slate').css({
visibility: 'visible'
});
})

$('#choose-shale').click(function() {
	$('#choose-shale')css({
        visibility: 'hidden'
    });
    $('#choose-baslt')css({
        visibility: 'hidden'
    });
    $('#choose-slate')css({
        visibility: 'hidden'
    });
})

});`

The title says everything. I'm using JSFiddle. The HTML and CSS are fine, but the JS doesn't run as soon as I have multiple events in my jQuery. (There's other Javascript that isn't jQuery in the JS file but it doesn't work for a different reason.) When I only had this it worked:

$(document).ready(function() {
$('#start').click(function() {
$('#start').hide();
$('#choose-shale').css({
visibility: 'visible'
});
$('#choose-basalt').css({
visibility: 'visible'
});
$('#choose-slate').css({
visibility: 'visible'
});
})
});

Is it possible to have multiple events in a single $(document).ready? If not, how do I cause all the effects I need (and there are many more, in the same format) with the events that cause them? Multiple $(document).ready s?
Thanks in advance!


#2

css is a method, it should be preceded by a dot.

$(document).ready(function() {
    $('#start').click(function() {
        $('#start').hide();
        $('#choose-shale').css({
            visibility: 'visible'
        });
        $('#choose-basalt').css({
            visibility: 'visible'
        });
        $('#choose-slate').css({
            visibility: 'visible'
        });
    });
    $('#choose-shale').click(function() {
        $('#choose-shale').css({
            visibility: 'hidden'
        });
        $('#choose-baslt').css({
            visibility: 'hidden'
        });
        $('#choose-slate').css({
            visibility: 'hidden'
        });
    });
});

#3

I'm such an idiot oh god. Thank you so much


#4

Simple mistakes are part of the coding adventure, it's nothing wrong :slightly_smiling:

You're very welcome!