js如何动态改变onclick参数

jhhwb 2010-10-17 06:02:09
<a id="txtTotal1" onClick="personalInfo(<%=rs_p("ProdId")%>,XXX"><img src="images/add_order.gif" /></a>

<script type="text/JavaScript">
function checkInt(o){
..
var vonClick=document.getElementById("c").value;
}
</script>
vonClick 已经checkInt事件后取值

要求:xxx同步取值vonClick的值 该怎么写?
...全文
471 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
<script>
Function.prototype.Bind=function(){
var o = this;
var argus = arguments;
return function(){o.apply(o,argus);};
}

document.getElementById("txtTotal1").onclick = (function(){var zz=document.getElementById("c").value; return personalInfo.Bind(<%=rs_p("ProdId")%>,zz);})();
</script>

不好意思,少了个执行...
happy664618843 2010-10-17
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 liuxiaoyi666 的回复:]

<script>
Function.prototype.Bind=function(){
var o = this;
var argus = arguments;
return function(){o.apply(o,argus);};
}

document.getElementById("txtTotal1").onclick = function(){var zz=doc……
[/Quote]
  • 打赏
  • 举报
回复
<script>
Function.prototype.Bind=function(){
var o = this;
var argus = arguments;
return function(){o.apply(o,argus);};
}

document.getElementById("txtTotal1").onclick = function(){var zz=document.getElementById("c").value; return personalInfo.Bind(<%=rs_p("ProdId")%>,zz);};
</script>
qq346 2010-10-17
  • 打赏
  • 举报
回复
飘过…………
jhhwb 2010-10-17
  • 打赏
  • 举报
回复
是先checkInt了 已经有新的vonClick值 现在就是要怎么写让XXX取到vonClick的值
kebin0001 2010-10-17
  • 打赏
  • 举报
回复
你不可能改寫那個值。
按照你的需求你只要先checkInt,然後就有值,用新的值去計算,不需要用XXX。

87,997

社区成员

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

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