I have an html structure like this:
<div id="container1">
<p>Texto</p>
</div>
<div id="container2">
<p>Texto</p>
</div> N vezes este bloco
<div id="containerN">
<p>Texto</p>
</div>
I would like to know how I can get the last id="containerN"
, separate the number that equals N
and put it in a variable. For example, if the last one is ID="container22"
I want to put it in the cont=22
variable.