JSFiddle - React, Tailwind, and code Playground

HTML

<p>Current p is: <span></span></p>
<a href="para1" contenteditable>This is the first paragraph</a>
<p id="para2" contenteditable>Second paragraph is this one</p>

JavaScript

$(document).on("focus","p[contenteditable]",function(){
    $("span").html($(this).attr("id"))
})
$(document).on("blur","p[contenteditable]",function(){
    $("span").html('')
})