Javascript Style How to - Get "inline" display property








Question

We would like to know how to get "inline" display property.

Answer


<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'>
window.onload=function(){<!--   www  .j av a2 s.  co m-->
    var aTag = document.createElement('a');
    document.body.appendChild(aTag);
    var d = window.getComputedStyle(aTag).display;
    console.log(d)
}
</script>
</head>
<body>
</body>
</html>

The code above is rendered as follows: