If you want you can simply do this with the CSS
a[href="\#"], a[href=""] {
cursor: default;
}
/* I've used an element[attr] selector here which will select all a tags
with this combination, if you want to target specific a tags,
wrap them in an element with a class and you can than refer as
.class a[href]... */
If you want to disable the links, you can achieve that too using CSS pointer-events: none;
property
Demo 2 (Will help you if JS is disabled, this won't alert the message, but it will help you to disable the event which you are trying to do)