I am working on a music streaming website and i have this code and i want to know how to prevent page from changing song after i click on the href link
$.post("includes/handlers/ajax/getAlbumJson", {albumId: track.album}, function(data){
var album = JSON.parse(data);
$(".albumLink img").attr("src", album.artworkPath);
$(".albumLink img").attr("onclick", "openPage('album.php?id=" + album.id + "')");
$(".trackName span").attr("onclick", "openPage('album.php?id=" + album.id + "')");
$(".trackName a").attr("href", "album.php?id=" + album.id + "");
});
<span class="trackName dark-primary-hover">
<a href="" role="link" style="pointer-events: auto;"></a>
</span>