Q:

Workaround for classList `undefined` in legacy browser?

The following code works in all modern browser but on legacy it throws an error. How can I work around this? 
Error:
TypeError: Result of expression 'document.getElementById("profile").classList' [undefined] is not an object.

Code:
document.getElementById("mixdesign").addEventListener("webkitAnimationEnd",    design);

function design(){
  "use strict";
  document.getElementById("profile").classList.add("animation");
  location.href = "#profile"; 
} 

see Fiddle: https://jsfiddle.net/mm0o5jhw/3/

A:

IE9 and older don't support classList. As you've tagged the question with jQuery, you can use $.fn.addClass instead:
$("#profile").addClass("animation").

