_mercury 🇵🇸_
Reactiflux3y ago
5 replies
_mercury 🇵🇸

✅ – ✅ – _mercury – 21-27 Oct 6

    let prodState = [];
    function populateProductState(tag) {
        $(".product-state-tags").empty();
        prodState.forEach((tag) => {
            if (tag.trim() !== "") {
                $("ul.product-state-tags").append(`
                <li >
                    <span class="delete-tag" >x</span>

                    <span class="m-1 p-1 tag-value">${tag}</span>
                </li>
            `);
            }
        });
        $(".product-state-input").val("");
    }
how to get the text value of the
.tag-value
value when clicking
.delete-tag
span ?
using jquery
Solution
this works
if anybody interested
(e.target).next().text()
Was this page helpful?