What I understand from your words is that you want to create a link just to run JavaScript code.
Then you should consider that there are people who blocks JavaScript out there in their browsers.
So if you are really going to use that link only for running a JavaScript function then you should add it dynamically so it won't be even seen if the users didn't enable their JavaScript in the browser and you are using that link just to trigger a JavaScript function which makes no sense to use a link like that when JavaScript is disabled in the browser.
For that reason neither of them is good when JavaScript is disabled.
Aand if JavaScript is enabled and you only want to use that link to invoke a JavaScript function then
<a href="javascript:void(0)" onclick="myJsFunc();">Link</a>
is far better way than using
<a href="#" onclick="myJsFunc();">Link</a>
because href="#" is going to cause the page to do actions that are not needed.
Also, another reason why <a href="javascript:void(0)" onclick="myJsFunc();">Link</a>
is better than <a href="#" onclick="myJsFunc();">Link</a>
is that JavaScript is used as the default scripting language for most of the browsers. As an example Internet Explorer, uses an onclick attribute to define the type of scripting language that would be used. Unless another good scripting language pops up, JavaScript will be used by Internet Explorer as the default too, but if another scripting language used javascript:
, it would let Internet Explorer to understand which scripting language is being used.
Considering this, I would prefer using and exercising on
<a href="javascript:void(0)" onclick="myJsFunc();">Link</a>
enough to make it a habit and to be more user friendly please add that kind of links within the JavaScript code:
$(document).ready(function(){
$(".blabla").append('<a href="javascript:void(0)" onclick="myJsFunc();">Link</a>')
});