<li>jsvar = <?php echo $myvar; ?>;<li>document.write(jsvar); // Test to see if its prints 10:<li> 复制代码 Form variable to Javascript variable: <li>jsvar = document.myform4.formvar.value;<li>document.write(jsvar) // test<li> 复制代码 PHP variable to Form variable: // PHP code inside HTML!! 复制代码 Javascript variable to Form variable: <li>jsvar=10;<li>document.myform3.formvar.value = jsvar;<li> 复制代码 怎么样,以上代码对您有所帮助吗?