How can I add a title attribute to wp admin menu?

Solution:

You are using id #menu-dashboard to find element in jQuery. But you don’t have id in you element <div class="wp-menu-name">Dashboard</div>

Either you can assign id to your div tag <div id="menu-dashboard" class="wp-menu-name">Dashboard</div>

Or you can find your element using class in jQuery $( ".wp-menu-name" ).attr( "title", "My New Title" );