form_func1.php 558 Bytes
<!DOCTYPE html>
<html>
	<form method="post" action="main.php">
		<input type="button" id="func1" name="func1" class="func-button" value="" onclick="this.form.submit()"/>
		<input type="hidden" id="func1" name="func1" value="FUNC1" class="btn-outline-danger"/>
	</form>
	<script type='text/javascript'>
		var elem = document.getElementById('cam<?php echo $i ?>');
		var pos = elem.getBoundingClientRect();
		var btn = document.getElementById('func1');
		btn.style = "top : "+pos.bottom+"px; left : "+pos.x+"px";
		console.log(pos.bottom);	
	</script>
</html>