0
有一个隐藏字段想要使用该字段在图中的值。 有可能吗?以下是我使用的代码示例。传递变量形式javascript
<input type="hidden" name="valor" id="valor" value="20" />
window.onload = function() {
var teste = (document.getElementById("valor").value);
dataPoints: [
{ label: "apple", y: 10 },
{ label: "grape", y: teste }]
谢谢
'teste'是一个字符串。你将不得不把它解析为一个数字:'parseInt(teste,10)' – Andreas
你还没有添加你的功能 – brk
,所以什么不工作? – epascarello