jqueryiconssemantic-uiremovable

How to use Semantic UI removable icon


Semantic UI haven't documented how the removable widget works.

Below is an example of what I mean

The small x icon is what I mean by removable. What is the Semantic UI call I need to get this to make this work so that when I click on the small x it removes that element?


Solution

  • Managed to do this manually using the following function:

    var removeParent = function(e) {
        $(e).parent().remove();
    };
    

    Then in my HTML I added an onclick event to the element and passed in this.

    <div class="ui huge label" style="margin: 7px"> 
        <i class="edit icon"></i> 
        <i class="delete icon" onclick="removeParent(this)"></i>
    </div>
    

    Answer taken from Here