Getting Textbox value in Javascript

前端 未结 6 2185
执念已碎
执念已碎 2020-12-02 00:06

I am trying to get the value of the textbox in a javascript, but its not working. Given below is the code of my test page

<%@ Page Title=\"\" Language=\"V         


        
6条回答
  •  天涯浪人
    2020-12-02 00:53

    The ID you are trying is an serverside.

    That is going to render in the browser differently.

    try to get the ID by watching the html in the Browser.

    var TestVar = document.getElementById('ctl00_ContentColumn_txt_model_code').value;

    this may works.

    Or do that ClientID method. That also works but ultimately the browser will get the same thing what i had written.

提交回复
热议问题