JSFiddle - React, Tailwind, and code Playground

HTML

<input class="test" type="button" test="value before change" value=" CLikc me"/>

JavaScript

$(document).ready(function(){
    alert("My attr value is: "+$(".test").attr("test"));
   $(document).on("mousedown",".test", function(){
      $(this).attr("test","new value");        
   });
          $(".test").click(function(){ alert("My new value is: "+$(this).attr("test"))});
});