I want to get the postid "36121" from the body tag with JavaScript
Here is the body tag
<body data-rsssl="1" class="post-template-default single single-post postid-36121 single-format-gallery classic-nav no-title sticky-nav" data-pin-hover="true">
Here is my Code
alert($('.post-template-default').attr('class').split('postid-')[1]);
But i get this one "36121 single-format-gallery classic-nav no-title sticky-nav" and i need only this one "36121".
Can someone help me here?