您现在的位置是:首页 > 电脑技术查询 > web开发

一个关于变量的简单有关问题(在线)

编辑:chaxungu时间:2022-10-02 23:22:54分类:web开发

一个关于变量的简单问题(在线)
<script language= "javascript ">
var txt_price = document.getElementById( "txt_price ");//单价
function original1()
{
txt_price.value = "300 ";
}

function original2()
{
txt_price.value = "400 ";
}
</script>

1.这样写为什么提示缺少对象
2.应如何解决
多谢!

------解决方案--------------------
简单的顺序问题...