title: How to retrive value from @Html.TextBoxFor in a external javascript file
body: <p>I am using MVC 4 in my create view i have the following code </p>
  
  <pre><code>@Html.TextBoxFor(model =&gt; model.USER_EMAIL, new { @class = "form-control", id="userModelEmail" })
  @Html.ValidationMessageFor(model =&gt; model.USER_EMAIL)
  </code></pre>
  
  <p>I have added a reference to my view </p>
  
  <pre><code>&lt;script src="~/Contents/Common.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Inside the <code>common.js</code> I want to get the value  from the <code>TextBoxFor</code> .I have added the following code in my common.js</p>
  
  <pre><code>$("#btnRegister").click(function () {
      debugger;
      var userData = {
          userEmail: document.getElementById('USER_EMAIL').value(),
          userPassWord: document.getElementById('userModelPwd').value(),
          userConfirmPassword: document.getElementById('userModelCfmPwd').value(),
          userMObile: document.getElementById('userModelMob').value(),    
      }
      debugger;
          $.ajax({
              type: "POST",
              url: 'Home/Register',
              data: '{userDetails:' + JSON.stringify(userData) + '}',
              success: function (res) {
                  debugger;
                  //  alert("data is posted successfully");
                  if (res.success == true) {
                      debugger;
                      $('#modalLogin').modal('show');
                     // window.location.href = window.location.href + res.AdminLocation;
                      debugger;
                  } else {
                      document.getElementById("lblInvalidUser").style.display = "inline";
                  }
              },
              error: function (xhr, textStatus, errorThrown) {
                  alert(xhr.statusMessage);
                  return false;
              }
          });
  
          return true;
  });
  </code></pre>
  
  <p>but at the line of userEmail: <code>document.getElementById('USER_EMAIL').value()</code> the <code>USER_EMAIL</code> is showing cant not resolve I have also tried with the id
  <code>document.getElementById('userModelEmail').value()</code> here also its showing the id cant be resolve.</p>
  
  <p>How to solve it?</p>