Click in the input field, then activate the Cap Lock key and click in the input field again:
Note: The getModifierState() method is not supported in Safari 10 or IE 8 and earlier versions.