I want to change container’s property by clicking on an image.
Why this doesn’t work:
<script type="text/javascript">
function changeMargin(){
document.getElementById("container").style.margin.top="100px";
}
</script>
<div id="container">
<img id="btnRight" src="img/btnRight.png" onclick="changeMargin()">
</div>
It should be
Full code: