JSFiddle - React, Tailwind, and code Playground

HTML

<div id="test" style="background:#7FFFD4; width:1000px; margin:20px; height:20px; position: relative;">Area For Test</div>

JavaScript

$(document).ready(function () {

    $("#test").click(function (e) {
        $('#abc').remove();

        var x = Math.round(e.pageX) + "px";
        var y = Math.round(e.pageY) + "px";

        $('<span id = "abc">' + 'sampleText' + '</span>').css({
            'position': 'absolute',
            'top': y,
            'left': x
        }).appendTo('#test');

    });

});