Gabriel
Gabriel

Reputation: 81

jQuery: Show several elements at once

Is there a function like this:

$.show('#anID, .aClass, .anotherClass, #anotherID');

I don't want to write each time

$('#anID').show();
$('.aClass').show();
// etc...

Upvotes: 0

Views: 39

Answers (1)

R. Oosterholt
R. Oosterholt

Reputation: 8080

You had the selector and function mixed up:

$('#anID, .aClass, .anotherClass, #anotherID').show();

Upvotes: 1

Related Questions