I have an HTML table where certain TDs contain inline styles, title tags, and links. I am looking to implement a feature where users can hide these elements by clicking the same icon multiple times. For example, on the first click, only styles are removed, on the second click, only links are removed, on the third click, only title tags are removed, on the fourth click, everything is removed, and on the fifth click, all elements are restored.
Currently, I am able to remove individual elements using the following code snippets:
$('a .icon-remove').click(function () {
$('.mindteq_content_tbl_container td[style]').css('background-color', '').css('color', '');
});
The same process can be applied to title tags and links as well:
$('.tbl_container td a[title]').remove();
$('.tbl_container td a').removeAttr('href').css('border-bottom', '0px');
However, I am unsure of how to create a button with 5 different states to achieve this functionality.