You cannot change whether the lock key is on or off. However, you can change whether your input strings will be lower or upper case with Javascript based on whether the lock key is on or off.
for (char in inputString) { if(capslock) { // do your caps lock detection here if(char === char.toUpperCase()) { // it upper case char = char.toLowerCase(); } else { char = char.toUpperCase(); } } }
source share