Normalise style attribute in javascript

48 Views Asked by At

In IE11 when we block.getAttribute('style') we return

border-bottom-width: 1pt; border-bottom-style: dotted; border-bottom-color: rgb(10, 49, 132)

But in chrome it returns border-bottom: 1pt dotted rgb(10, 49, 132)

How do I get the IE11 to return the same as chrome?

2

There are 2 best solutions below

0
On

I think is this in IE11

block.style.border-button

Because is only information "border-button"

0
On

Both browsers have different default styles for page elements. Use this default from Chrome: https://gist.github.com/ambidexterich/34828a904dd97dd2a345