I was having same requirement. and this works for me.
$(document).ready(function() {
$(document).ready(function() {
$("body #s4-topheader2. ul li ul li a").attr("href","javascript:void(0);");
});
});
May be it helps you.
Don't forget to include JQuery in your master page.