jquery - Retrieve display property using javascript -


<style type="text/css"> { display: none; } </style>   <p id="p"> paragraph </p>  <a href="google.com"; id="a">google</a> <script type="text/javascript">      var = (document.getelementbyid('a')).style;     alert(a.display);     var p = (document.getelementbyid('p')).style;     alert(p.display);     p.display = 'none';     alert(p.display); </script>  

how retrieve display property of anchor tag correctly? thanks.

use .css()

var value = $(element).css('display') 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -