Impossible to get border's value

时间:2016-04-04 17:07:38

标签: javascript jquery css events

My code:

<head>
<style> 
#doit{
    border:5px solid blue;
    color:white
}
</style>
</head>

<button id="doit">Click me </button>
<script> 
$('#doit').click(function(event){
      console.log ($(event.currentTarget).css('border'));
      var x=window.getComputedStyle(event.currentTarget);
      console.log(x.border);
      });
   </script>

It is just impossible to get the border value in Mozilla and IE11. Chrome works fine!! To get things more strange if I change border with color everything is fine. How may I solve this problem? Neither borderWidth works... However, I want to get border's value. Please, help!

0 个答案:

没有答案