如何将HTML / php变量传递给JavaScript [英] How to pass HTML/php variable into JavaScript
本文介绍了如何将HTML / php变量传递给JavaScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望表单能够根据HTML / php变量的逻辑自动选择单选按钮。示例如下所示:
javascript :
I wish to have the form to be able to automatically select the radio button based on the logic of HTML/php variable. example show below:
javascript:
展开 | / span> 选择 | 换行 | 行号
推荐答案
嗨...
欢迎来到TSDN ...
你必须使用当你确定
hi ...
welcome to TSDN ...
you have to use single quotes inside the onload, or no quotes when you are sure that
值始终是一个数字并且
值必须打印到html页面时,onload中的单引号或没有引号(必须在发送给客户端之前进行处理):
value must be printed to the html page (that has to be processed before sent to the client):
展开 | 选择 | 换行 | 行号
这篇关于如何将HTML / php变量传递给JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文