I have been using the replace function since long to remove the classes from JavaScript, Now I was making the JavaScript function for that through which, I can pass an element and the class name to remove the class from the same.
changeAddress.className = changeAddress.className.replace(new RegExp('(?:^|\\s)' + 'hide' + '(?:\\s|$)'), ' ');
Or
document.getElementById("MyID").className =
document.getElementById("MyID").className.replace(/\bMyClass\b/,'');
So can someone suggest me how to pass the class "hide" and "MyClass" Dynamically in the same?