Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2024 08:26 PM - edited 04-10-2024 04:24 PM
You can do this with DOM manipulation (which is discouraged, but since you're currently using it in your script I imagine it's not an issue for you):
var firstPencilIcon = this.document.querySelector("a.fa.fa-pencil");
if(firstPencilIcon) firstPencilIcon.remove();
First, select the pencil-icon on the page with querySelector (this selects the first match, hence the one from the first row), and then delete it with remove. I've added an if-statement to do a check to ensure the element exists before it's removed to avoid potential errors.
You can check the browser support for these methods here:
- querySelector: https://caniuse.com/queryselector
- remove: https://caniuse.com/mdn-api_element_remove