i want if div size width:100%;height:100% then also canvas size is width:100%;height:100% (not using pix)
<div id="parent" style="position:absolute;background-size:100% 100%;background-color:blue;width:100%;height:100%">
<canvas id="theCanvas" style="background-color: red;">
</canvas>
</div>
<script>
$(document).ready(function() {
var canvas = document.getElementById("theCanvas");
canvas.width = $("#parent").width();
canvas.height = $("#parent").height();
canvas.position = $("#parent").position();
canvas.background-size = $("#parent").background-size();
});
</script>