JSFiddle - React, Tailwind, and code Playground
HTML
<span id="root" contenteditable="true" onkeyup="test(event, this)">This is changable<span contenteditable="true" onkeyup="test(event, this)" id="childOfroot"> | including this</span></span>
JavaScript
function test(event, element){
console.log($(element).attr('id'))
}