Posted by : Jebastin Wednesday 15 January 2014

Consider the following HTML:
  1. <div id="jjTechSol" style="height: 50px;width: 50px;">
  2.  <p>Content</p>
  3.  </div>
The following jQuery is used to get the value of a CSS property.
  1. <script type="text/javascript">
  2. $(document).ready(function () {
           alert('Height:'+$("#jjTechSol").css('height'));
  3.        alert('Width:'+$("#jjTechSol").css('width'));
    });
  4. </script> 
.css( propertyName ) gets the value of style properties for the first element in the set of matched elements.
     propertyName
     Type: String    
     A CSS property.

Leave a Reply

Subscribe to Posts | Subscribe to Comments

Link To This Post/Page

Spread The Word

Add this button to your blog:
JJ Technology Solutions

Blog Archive

Trackers

eXTReMe Tracker
facebook

- Copyright © JJ Technology Solutions - Powered by Source Code Solutions -