Wrong use of JavaScript 'replace' function
I sometimes forget that JavaScript's 'replace' function returns the changed value and does not change the string itself. I sometimes miss out the first line in code like this: targetElement.className = targetElement.className. replace(/[ ]*vtSettingsRadioButton/g, ''); Here I am removing a CSS class from an HTML element.