javascript中bind函数的作用实例介绍

时间:2021-01-19 18:54:30
【文件属性】:
文件名称:javascript中bind函数的作用实例介绍
文件大小:28KB
文件格式:PDF
更新时间:2021-01-19 18:54:30
AS asc bin <!DOCTYPE html> <html> <head> <meta charset=utf-8> <style> button {background-color:#0f0;} </style> </head> <body> <button id=button> 按钮 </button> <input type=text> [removed] var button = document.getElementById(button); button.onclick = function() { alert(this.id); // 弹出button }; //可以看出上下文的t

网友评论