Retrieve value from asp:textbox with JQuery

后端 未结 6 1532
闹比i
闹比i 2020-12-06 16:29

I have a few asp:textbox controls in a form on a webpage, below is a snippet. The first is a field where the recipient is entered, the other is a larger textarea where the r

6条回答
  •  再見小時候
    2020-12-06 16:57

    Through this you can also get asp button or any control for that matter.

    var txt_recipient = document.querySelector("input[id*='recipient']");
    alert(txt_recipient.Value);
    

    you can also try querySelectorAll() if you have multiple controls with same id in client side.

    jQuery Equalent is

    $("input[id*='recipient']").val()
    

提交回复
热议问题