So, I'm playing with $(el).css() , trying to determine if an element has a border. I use .css("border-style", "solid") to set the frame, which works, but actually it sets 4 separate styles:
border-right-style border-left-style border-top-style border-bottom-style
So, checking the border is a little cumbersome, since you need to do something like:
if ($(el).css("border-right-style") == "solid" && $(el).css("border-left-style") == "solid" && ...) {}
Just checking for $(el).css("border-style") != "" Does not work, because border-style always equal to "".
Is there a more elegant way to do this?
source share