Javascript – Get The Hash Tag Value From A URL
So, you have the following URL: http://www.example.com/page/#comment-12 You want to get the value after the hash tag (#), which is comment-12 The following Javascript code will help you achieve what you’re after: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 <script type="text/javascript"> //check if hash tag exists [...]
brightcherry.co.uk