Javascript examples for Number Operation:Integer
Slice or Trim only last characters by certain integer
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*from w w w.ja va 2 s .c o m*/ var imgSrc = 'http://www.java2s.com/broken/images/something/16.png'; var srcID = imgSrc.split('/').pop().replace(/\D+/,''); document.body.innerHTML = srcID; } </script> </head> <body> </body> </html>