samedi 17 juillet 2021

How do i get the value from the textbox entered and get displayed in div tag using jquery? [duplicate]

Now the thing is that on entering some text in textbox and when i click Ok button I should get the message displayed as "Welcome" + the inputed text. I tried below using jquery but it isn't working.

$(document).ready(function() {
      $("#btnId").click(function() {
        var inputValue = $("#txt").val();
        $("#address").text("\"Welcome" + " " + inputValue "\");

        }
      })
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

Enter your name:<input type="text" id="txt>
    <button id=" btnId ">Ok</button>
    <div id="address "></div>



Aucun commentaire:

Enregistrer un commentaire