Javascript code to add aria-haspopup attribute to nav elements.