Danny
Danny

Reputation: 1005

How to get the value of element with selector

Example:

$(document).ready(function(){    

   height = $('#container-bottom:before').height();
   alert(height);

});

Alerts null (and I know the value is not null of course).

Upvotes: 0

Views: 130

Answers (1)

Alex Peattie
Alex Peattie

Reputation: 27667

Unfortuantely CCS pseudo-elements (like :before, :after) are not part of the DOM (although they're rendered as if they were) - thus they can't be manipulated with jQuery.

See: Selecting and manipulating CSS pseudo-elements such as ::before and ::after using jQuery

Upvotes: 5

Related Questions