.cars{
display: none;
}
#carone{
display: block;
}
<script src=”https://code.jquery.com/jquery-3.6.0.min.js”></script>
<script>
var $ = jQuery
$(document).ready(function(){
$(‘#red ‘).on(‘click’, function(){
$(‘.cars’).hide()
$(‘#carone’).show()
});
$(‘#blue ‘).on(‘click’, function(){
$(‘.cars’).hide()
$(‘#cartwo’ ).show()
});
$(‘#black’).on(‘click’, function(){
$(‘.cars’).hide()
$(‘#carthree’ ).show()
})
})
</script>