Search code examples
javascriptjqueryasp.nettelerik

How to get the middle Characters in javascript


I just want to Get hello in Label1

<script type="text/javascript">   
     result = "helloworld"         
     document.getElementById('<%= Label1.ClientID %>').innerHTML = result;
</script>

Solution

  • have you tried doing result.substring(0,5);

    <script type="text/javascript">   
     result = "helloworld"         
     document.getElementById('<%= Label1.ClientID %>').innerHTML = result.substring(0,5);
    </script>