escape $nav_id

esc_attr($nav_id) before echo