Object.keys(obj).map(function (key) { return obj[key]; });
var a = document.querySelector(".a");
function change(e) {
e.preventDefault()
a.innerHTML = "www.w3s.com";
a.setAttribute("href", "www.w3s.com");
a.removeEventListener("click", change);
}
a.addEventListener("click", change)
<a id="fakelink" data-href="http://google.com">click</a>
document.querySelector('#fakelink').addEventListener('click', function() {
var link = this.getAttribute('data-href')
this.setAttribute('href', link)
})
<p id="link" data-href="http://google.com">GET LINK</p>
<script>
document.querySelector('#link').addEventListener('click', function() {
let href = this.getAttribute('data-href');
this.innerHTML = `<a href=\"${href}\">${href}</a>`;
});
</script>