手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >js onclick事件传参讲解
js onclick事件传参讲解
摘要:1、在页面中给方法传参数有两种方法第一:onclick=cancel(id,patientId);在js文件中定义cancel方法如果要把当...

1、在页面中给方法传参数有两种方法

第一:onclick=cancel(id,patientId);

在js文件中定义cancel方法

如果要把当前对象传过去用onclick="cancel(this,id,patientId)"

js中cancel(obj,id,patientId)

第二:在js中用jquery$(function(){

var patientId=$("a").attr("patientId");

}),在页面中<tr patientId="${patientId}">

2、onclick事件

【js onclick事件传参讲解】相关文章:

javascript的 {} 语句块详解

javascript的事件描述

js鼠标事件

Javascript中Date类型和Math类型详解

JavaScript中的this,call,apply使用及区别详解

Javascript实现飞动广告效果的方法

浅谈javascript事件取消和阻止冒泡

TypeError document.getElementById(...) is null错误原因

showModelessDialog()使用详解

js事件监听器用法实例详解

精品推荐
分类导航