user5941701
user5941701

Reputation:

Jsoup - how to check if Element is of specific class?

This is my Element code:

<tr class="footer">...</tr>

In the table there are also other rows with other classes and I process each of them. How can I know if this processed tr element has "footer" class?

Upvotes: 3

Views: 1551

Answers (1)

blacktide
blacktide

Reputation: 12076

You're looking for the Element#hasClass method.

if (element.hasClass("footer")) {
    // do something
}

Upvotes: 4

Related Questions