Javascript examples for jQuery:String
Delete characters from certain character in string
<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>