jQuerybeast
jQuerybeast

Reputation: 14490

Make $(this) ID in class

I'm trying to set the this of which is an ID to the same string but in class.

For example:

$("#FirstBox").click(function () {
    $('.FirstBox').trigger('click');
});

Instead of typing .FirstBox, how can I set a variable so it's $(this) in class?

Upvotes: 0

Views: 337

Answers (1)

SLaks
SLaks

Reputation: 887479

$('.' + this.id)

Upvotes: 5

Related Questions