Hi,
If I have a list of DIV containers in HTML and the last container has a class of 'last', how can I use the IF statement to add the class?
This is some basic HTML code to illustrate my question:
The last DIV contains an additional class of 'last'.
Any thoughts?
Many thanks,
G.
If I have a list of DIV containers in HTML and the last container has a class of 'last', how can I use the IF statement to add the class?
This is some basic HTML code to illustrate my question:
- Code: Select all
<div class="box1">
<p>Some content</p>
</div><!--end box1-->
<div class="box1">
<p>Some content</p>
</div><!--end box1-->
<div class="box1 last">
<p>Some content</p>
</div><!--end box1-->
The last DIV contains an additional class of 'last'.
Any thoughts?
Many thanks,
G.