I have this simple javascript function which changes the body zoom of the web page. The function runs properly when I am having it on a HTML page as a normal javascript. When I embed it in PHP, it is not retaining the body zoom change. The javascript embedded in PHP can be shown as follows:
<?php
?>
<html>
<head>
<script language="javascript">
function zoomout()
{
document.body.style.zoom = screen.width/1024;
document.body.style.zoom = screen.height/1024;
}
</script>
</head>
<body>
<form name="test">
<center>
<br>
<br>
<button onclick="zoomout()">1024</button>
</form>
</center>
</body>
</html>
What am I doing wrong here. Thanks
Maybe try taking the form tags out. You really don’t need them if you aren’t submitting something somewhere