JSFiddle - React, Tailwind, and code Playground

by Ender

JavaScript

$(function() {
    //create snippet
    var mySnippet = $('<div><img src="item.png"/>&nbsp;<a href="#"><span>Hello</span></a></div>');
    
    //remove the link, using the snippet as the context
    $('a[href="#"]', mySnippet).replaceWith($('a[href="#"]', mySnippet).html());
    
    //insert the modified snippet
    $('body').append(mySnippet);
});