JSFiddle - React, Tailwind, and code Playground

by eddiarnoldo

HTML

<div id="test">
    
</div>

JavaScript

//Element is not in DOM
changeColor("AMPL1324730364");

function changeColor(id){
    
    console.log($("#"+id).length + " element(s) selected")
    $("#"+id).css("color","red")
}

//Add element to DOM
$("<label/>",{
    id:"AMPL1324730364",
    text:"AMPL1324730364"
}).appendTo("#test")


changeColor("AMPL1324730364");