Using data attributes in HTML5
HTML5 is designed with extensibility in mind for data that should be associated with a particular element but need not have any defined meaning. data-*attributes allow us to store extra information on standard, semantic HTML elements without other hacks such as non-standard attributes, extra properties on DOM, or Node.setUserData()
.
Get URL and URL Parts in JavaScript
If you are kooking for a site's URL information, then the window.location object is for you! Use its properties to get information on the current page address or use its methods to do some page redirect or refresh.