js中函数的参数可不可以是对象啊?

daixingyao 2004-08-14 01:37:07
比方说:
<form name="form1">
<input type="text" name="text1" disabled>
<input type="button" onclick="change(document.form1.text1)">
</form>

<script>
function change(var canshu){
canshu.disable=false;
}
</script>

js我市菜鸟,大虾较我怎么解决问题!

感激不尽!!
...全文
439 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
978107 2004-08-16
  • 打赏
  • 举报
回复
in the javascript,you can create a new object, and use a instance to clone the object ,and use it to do something.
笑看风云1203 2004-08-15
  • 打赏
  • 举报
回复
当然可以,最常用的 this 不就是对象吗?
daixingyao 2004-08-14
  • 打赏
  • 举报
回复
谢了

原来这种参数是可以的阿

感谢感谢
woyingjie 2004-08-14
  • 打赏
  • 举报
回复
<form name="form1">
<input type="text" name="text1" disabled>
<input type="button" onclick="change(document.form1.text1)">
</form>

<script>
function change(canshu){
alert(canshu)
canshu.disabled=false;
}
</script>

少写了一个D
woyingjie 2004-08-14
  • 打赏
  • 举报
回复
<form name="form1">
<input type="text" name="text1" disabled>
<input type="button" onclick="change(document.form1.text1)">
</form>

<script>
function change(canshu){
canshu.disable=false;
}
</script>

87,996

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧