What I want to do is know which element of my form has a red border and the one that has it when I close my form or save or cancel the action, the same one that was in red changes to a white border color.
then I would like to know how I identify which element has a different hue than the rest of my form objects and based on it apply an action.
I have this short code:
alert($("#txtNombreP").css("border-color"));
It appears to me as a blank alert, but if I put other properties if it brings me its value, I don't know if I write it wrong.
Assuming, because you don't put any code, you have an element and its border is a CSS class, called red-border and another blue-border
Then
I hope it helps you.
You can use
getComputedStyle
which returns the computed style of the element.Example:
The border is a special case:
because it has 4 sides :
and properties :
To access them you must access with the following structure:
You can iterate to elements, and ask about border properties with
if($(this).css('border-right-style')=="solid"){
example: