I am looking for code (HTMl, CSS, or javascript) or any way to solve my issue. I recently have been tasked to help with the design and function of my company's website. There is a page that will have a list of events that an employye will be at during the year. For example:
<div class="container3">
<div class="accordion">
<dl>
<dt>
<a href="#accordion1" aria-expanded="false" aria-controls="accordion1" class="accordion-title accordionTitle js-accordionTrigger">Travel Territory</a>
</dt>
<dd class="accordion-content accordionItem is-collapsed" id="accordion1" aria-hidden="true">
<p><li>Test 1</li>
<li>Test 2</li></p>
</dd>
<dt>
<a href="#accordion2" aria-expanded="false" aria-controls="accordion2" class="accordion-title accordionTitle js-accordionTrigger">Catch me at these schools!</a>
</dt>
<dd class="accordion-content accordionItem is-collapsed" id="accordion2" aria-hidden="true">
<p><ul id="myList">
<li>03/24/2018 at Upper Darby High School 1</li>
<li>03/24/2019 at Upper Darby High School 2</li>
</ul>
</p>
</dd>
</dl>
</div>
</div>
Is there any code that can remove elements of that list after they have passed? OR do I have to go in a manually remove it from the list every day?
I am not against recreating the whole list idea so anything will help! Thank you for all the help in advance!
You can write a Javascript function and use
var list = document.getElementById("myList");to get the list. You can remove list items usinglist.removeChild(list.childNodes[0]);You may specify the li element inside list.removeChild() using css selectors.