<html>
<head>
<style type="text/css">
p
{
border: thin dotted #FF0000;
}
</style>
<script type="text/javascript">
function changePadding()
{
document.getElementById("p1").style.paddingTop="2cm";
}
</script>
</head>
<body>
<input type="button" onclick="changePadding()" value="Change top padding" />
<p id="p1">This is a paragraph</p>
</body>
</html>