Skip to content
Advertisement

jQuery: How to calculate the maximal attribute value of all matched elements?

Consider the following HTML:

JavaScript

How would you find the maximal x value of all .a elements ?

Assume that all x values are positive integers.

Advertisement

Answer

Just loop over them:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement