JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" name="text" id="text">
<input type="button" id="button" value="Click">

JavaScript

$("#button").click(function(){
   
        var value = $("#text").val();
        value += ".html";
        $("#text").val(value);
        var fileName = $("#text").val();
         alert(fileName);
      
});