Is there any way to determine which page you are in javscript on?
Why I want to know, so that I can determine which page I'm on, and then set the element style accordingly.
document.URL will get the URL of the current page.
document.URL
To check for a specific page, you should use:
if ( document.URL.contains("homepage.aspx") ) { //Code here }
Get page URL on page
location.href
or
Set the style for an element by id:
document.getElementById('mydiv').style.border = '1px solid black';