You can use getComputedStyle()
.
var element = document.getElementById('image_1'),
style = window.getComputedStyle(element),
top = style.getPropertyValue('top');
console.log(top);
<img id="image_1">
More Related Contents:
- How to display an chage photo option on mouse hover similar to linkedin using Javascript? [closed]
- How to force browser to show image 3 inches wide?
- How to use Checkbox inside Select Option
- How do I simulate a mouseover in pure JavaScript that activates the CSS “:hover”?
- jQuery CSS plugin that returns computed style of element to pseudo clone that element?
- why javascript this.style[property] return an empty string? [duplicate]
- How to change/remove CSS classes definitions at runtime?
- How to stop a setTimeout loop?
- Scrollable div to stick to bottom, when outer div changes in size
- Check element CSS display with JavaScript
- Why is deprecated and what is the best alternative?
- How to save image from canvas with CSS filters
- Detecting that the browser has no mouse and is touch-only
- Ellipsis in the middle of a text (Mac style)
- Add inline style using Javascript
- how to disable DIV element and everything inside [duplicate]
- How Do I Stop My Web Content From Shifting Left When The Vertical Scrollbar Appears? Roll-Up of Advice 2017 [duplicate]
- Load HTML page dynamically into div with jQuery
- jQuery position DIV fixed at top on scroll
- Can you have a JavaScript hook trigger after a DOM element’s style object changes?
- Trigger CSS Animations in JavaScript
- Inject CSS stylesheet as string using Javascript
- Why does querySelector only select the first element and how can I fix this?
- Detect browser wrapped lines via javascript
- Multiple read more / read less sections are not working on a page
- How to remove jQuery Mobile styling?
- Google map custom marker with css rounded corner
- How to Bootstrap navbar static to fixed on scroll?
- How to use pagination on HTML tables?
- Toggle divs without using Javascript