PHP variable to Javascript variable: 复制代码 代码如下: <br>jsvar = <?php echo $myvar; ?>; <br>document.write(jsvar); // Test to see if its prints 10: <br> Form variable to Javascript variable: 复制代码 代码如下: <br>jsvar = document.myform4.formvar.value; <br>document.write(jsvar) // test <br> PHP variable to Form variable: 复制代码 代码如下: // PHP code inside HTML!! Javascript variable to Form variable: 复制代码 代码如下: <br>jsvar=10; <br>document.myform3.formvar.value = jsvar; <br>