Consider the following HTML:
<div class="a" x="6"></div>
<div class="a" x="9"></div>
<div class="a" x="2"></div>
...
<div class="a" x="8"></div>
How would you find the maximal x value of all .a elements ?
Assume that all x values are positive integers.
Just loop over them: