<html>
<head>
<style>
#myDiv {
border: 1px solid #FF0000;
}
</style>
</head>
<body>
<div id="myDiv" style="padding-left:5cm;">This is a div.</div>
<br>
<button type="button" onclick="myFunction()">Return left padding</button>
<script>
function myFunction() {
alert(document.getElementById("myDiv").style.paddingLeft);
}
</script>
</body>
</html>