• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 236
  • Last Modified:

How can I get asp.net element via javascript??

<http>
      <head>
            <script language="javascript">
                  function GetString()
                  {
                        var add = document.getElementById("byStr");
                                add += "World";
                  }
            </script>
      </head>
      <body>
            <input type="text" id="btStr" value="Hello"/>
            <input type="button" id="btOK" value="OK" onclick="GetString()"/>

      </body>
</http>


I click the button but nothing happen.
I want the text expose "Hello World" after click the button
0
tatamaruri
Asked:
tatamaruri
1 Solution
 
RimvisCommented:
You have a typo in your code
var add = document.getElementById("byStr");
should be
 var add = document.getElementById("btStr");

0
 
tatamaruriAuthor Commented:
thanks.
IT is stupid mistake
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now