Don't assume default variant in JS. Let this be controlled by HTML markup.

Fixes #4849