Write som text in the input field, then activate the Cap Lock key and write some more text in the input field:
Note: The getModifierState() method is not supported in Safari 10 or IE 8 and earlier versions.