Delete characters from certain character in string - Javascript jQuery

Javascript examples for jQuery:String

Description

Delete characters from certain character in string

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js"></script> 
  <script type="text/javascript">
    window.onload=function(){/*from w ww  . j  av  a2s  . com*/
var div = $('#mydiv');
var text = div.text();
div.text(div.text().substring(0,15));
    }

      </script> 
 </head> 
 <body> 
  <div id="mydiv">
    12345678911131517192123 
  </div>  
 </body>
</html>

Related Tutorials