I have a situation where I am using CSS to color a field based on a condition. Once my condition is met, I color the field.
$(this).find('.att input').attr('style', 'background-color: #C12200 !important;border: none; color:white;');
However, the color (CSS formatting is lost in the final archive).
From what I have read, I should not be referencing the field as an input or by class name but instead using [type="number"] to find and set the CSS on the field. However if I don't specify the class name, I am not longer specifying which number fields I want to work with, also I am not cycling through each one any longer where I can add conditional logic.
Is there a way to conditionally set the style attribute on each field using javascript that will remain in the final archive.