JSFiddle - React, Tailwind, and code Playground
by pphheerroonn
HTML
<table id="shopping-cart-table" class="cart-table data-table">
<colgroup><col width="1">
<col width="1">
<col width="1">
<col width="1">
<col width="1">
<col width="1">
</colgroup><thead>
<tr class="first last">
<th rowspan="1"><span class="nobr">Product</span></th>
<th rowspan="1"> </th>
<th class="a-center cart-price-head" colspan="1">
<!-- <div class="cart-price-placeholder">-->
<span class="nobr">Price</span>
<!-- </div>-->
</th>
<th rowspan="1" class="a-center">
Qty
</th>
<th class="a-center cart-total-head" colspan="1">
<!-- <div class="cart-total-placeholder">-->
Subtotal<!-- </div>-->
</th>
<th class="a-center" rowspan="1"> </th>
</tr>
</thead>
<tfoot>
<tr class="first last">
<td colspan="50" class="a-right cart-footer-actions last">
<!-- Make this button the first responder rather than empty cart -->
<button type="submit" style="visibility:hidden;" data-cart-item-update="" name="update_cart_action" value="update_qty" title="Update Shopping Cart" class="button2 btn-update"><span><span>Update Shopping Cart</span></span></button>
<button type="submit" name="update_cart_action" data-cart-empty="" value="empty_cart" title="Empty Cart" class="button2 btn-empty" id="empty_cart_button"><span><span>Empty Cart</span></span></button>
<button type="submit"...
JavaScript
//let divs = document.getElementById('shopping-cart-table').getElementsByClassName('first');
let divs = document.getElementById('shopping-cart-table').getElementsByTagName("tr");
for (let x = 0; x < divs.length; x++) {
let div = divs[x];
let content = div.innerHTML.trim();
if (content.includes("BTC2020")) {
//div.style.display = 'none';
div.innerHTML = "<td colspan='6'><div class='student-promo-cart'>Student Promo Applied</div></td>";
}
}