Javascript examples for jQuery:String
Get part of a string using regex match
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.4.2.js"></script> <script type="text/javascript"> $(window).load(function(){/*from ww w.j av a 2 s. c o m*/ $(function() { console.log($("div").attr("id").match(/[\d]+$/)); }); }); </script> </head> <body> <div id="block-id-45"></div> </body> </html>