I am trying to modify a 3rd party span (in other words, I don't have access to that part of the code) by using either slice, replace, etc. However, none of the methods I have tried are working as they all bring me the same error:
Uncaught TypeError: str.substring is not a function
at cutId ((index):1004)
at (index):1006
The code I am trying to modify is as below:
<div class="vpe_table_responsive">
<table class="vpe_table" id="vpe_table">
<thead>
<tr>
<th>Title</th>
<th>Price</th>
<th>Quantity</th>
</tr>
</thead>
<tbody class="pagination_row">
<tr class="vpe_row variant-1843" data-tobeshown="no">
<td data-title="Title" id="vpe-title-td-1843" class="vpe-img-td">
<span>Talla 4 (#1843)</span>
</td>
In the webpage, Under the title, I have the size (Talla 7) followed by an id all within the same span tag. My objective is to eliminate the (#1843) from the title column.
Here is what I have tried:
<script>
function cutId() {
let str = document.querySelectorAll(".vpe-img-td");
str = str.substring(-7);
}
cutId();
</script>