parseInt
gives you the numerical value:
var tmp = parseInt(document.getElementById(nameVar).style.left, 10);
console.log(tmp);
or, as @PeteWilson suggests in the comments, use parseFloat
More Related Contents:
- How to have html popup appear over main html page?
- How to create a translucent in React Native?
- Write tags in HTML and print
- How to disable HTML links
- Cross-browser multi-line text overflow with ellipsis appended within a fixed width and height
- Refresh/reload the content in Div using jquery/ajax
- How to prevent Unicode characters from rendering as emoji in HTML from JavaScript?
- Can you style an html radio button to look like a checkbox?
- Animate element to auto height with jQuery
- How to style “input file” with CSS3 / Javascript? [duplicate]
- Changing element style attribute dynamically using JavaScript
- How do I clear the content of a div using JavaScript? [closed]
- How to get nth-child selector to skip hidden divs [duplicate]
- How to make div fixed after you scroll to that div?
- Force browser to trigger reflow while changing CSS
- How to auto-scroll to end of div when data is added? [duplicate]
- javascript change background color on click [closed]
- How to reorder divs using flex box?
- How to keep the menu state on page reload
- HTML Alignment Issue in one machine only (both IE8)
- CSS height 100% percent not working [duplicate]
- Setting minimum size limit for a window minimization of browser?
- Find first scrollable parent
- Creating Drop Down Menu on click CSS
- CSS Textarea that expands as you type text [duplicate]
- Google’s Imageless Buttons
- Detect if dropdown navigation would go off screen and reposition it
- Iframe inherit from parent
- How to apply background-color to a selected option?
- Get All Elements in an HTML document with a specific CSS Class