Disable all links with javascript

Hello,
I want to disable all links that only have a hashtag as href.
The cursor should stay default when hovering over it and there should be no jump when clicking on it.
But normal anchors should still work.

The following code does not seem to work:

jQuery( 'a[href="#"]' ).click(function( event ) {
  event.preventDefault();
});

Do you know how I could accomplish that?