When my application generates inline styles, I sometimes need to remove the height
, width
, and max-width
styles from certain elements.
I have identified the element using this code:
const elems = window.$('.myElements');
window.$.each(elems, (index, value) => {
if (value.id.startsWith('myPanel')) {
Then, I attempted the following methods:
window.$(value).css({height: '', maxWidth: '', width: ''});
window.$(value)[0].style.height = '';
window.$(value)[0].style.width = '';
window.$(value)[0].style.maxWidth = '';
window.$(value).css('height', '');
window.$(value).css('max-width', '');
window.$(value).css('width', '');
}
});
However, regardless of the method used, only the first element is affected. What could be causing this issue?