To get the account address of the contract that is currently logged in with Metamask I use this
web3.eth.getAccounts(function(error, accounts) {
document.getElementById('account-address').innerHTML = accounts;
});
How can i make it so address updates on UI when i change the account/ address in metamask, without having to refresh the website?