Click event doesn't work on dynamically generated elements
I couldn't get live or delegate to work on a div in a lightbox (tinybox).
I used setTimeout successfullly, in the following simple way:
$('#displayContact').click(function() {
TINY.box.show({html:'<form><textarea id="contactText"></textarea><div id="contactSubmit">Submit</div></form>', close:true});
setTimeout(setContactClick, 1000);
})
function setContactClick() {
$('#contactSubmit').click(function() {
alert($('#contactText').val());
})
}
Reference : https://stackoverflow.com/questions/6658752/click-event-doesnt-work-on-dynamically-generated-elements?rq=1
Click event doesn't work on dynamically generated elements的更多相关文章
- 【转】Using Raycasts and Dynamically Generated Geometry to Create a Line of Sight on Unity3D
http://www.linkedin.com/pulse/using-raycasts-dynamically-generated-geometry-create-line-thomas José ...
- Atitit vod click event design flow 视频点播系统点击事件文档
Atitit vod click event design flow 视频点播系统点击事件文档 重构规划1 Click cate1 Click mov4 重构规划 事件注册,与事件分发管理器分开 ...
- nodejs phantom add click event
page.evaluate( function() { // find element to send click to var element = document.querySelector( ' ...
- click event not triggered on bootstrap modal
I am trying to catch the click event when save changes is pushed. For some reason i can't catch the ...
- button click event in jqxgrid jqwidgets
button click event in jqxgrid jqwidgets http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/p ...
- shit mint-ui & navbar click event bug
shit mint-ui & navbar click event bug # Vue 2.0 npm install mint-ui -S // 引入全部组件 import Vue from ...
- js trigger click event & dispatchEvent & svg element
js trigger click event & dispatchEvent & svg element but svg element not support trigger cli ...
- svg click event bug & css pointer-events
svg click event bug & css pointer-events svg click event not working Error OK ??? css class /* d ...
- [CSS] Dynamically Size Elements with Pure CSS
Learn how to size elements based on the dimensions of the viewport, even when the browser is resized ...
随机推荐
- React-typescript-antd 常见问题
一.The key 'Accept' is not sorted alphabetically //tslint.json { "extends": ["tslint:r ...
- python值json与pickle模块
#json 是用来序列化对象的 # 只有2个方法,序列化与反序列化 # 但是不能序列化类 与 函数 import json dict={"key1":[1,2,3,4,5]} f ...
- CentOS 7 Gitlab+Jenkins持续集成+自动化部署
基于上次的环境<部署Gitlab+Jenkins持续集成环境> 来实现自动化部署 系统管理–>插件管理–>安装以下插件: Credentials Plugin(默认已经安装) ...
- SQL学习基础 => 创建表
--创建表 CREATE TABLE userinfo3 ( ID INT PRIMARY KEY NOT NULL, --ID 整数类型,设置为主键,并且不能为空 name ) NOT NULL, ...
- asp.net的<% %>特定用法
在asp.net应用程序中,在asp.net页面常用的<%@ %>.<%# %>.<%= %>.在全球化的项目中使用<%$ %>绑定资源项目,在asp. ...
- nginx 阻止非自己域名解析到服务器
server模块加入 default_server server { listen 80 default_server; return 403; # return 301 https://$serve ...
- 日常开发工作常用linux命令
:wq 保存退出 :q! 强制退出 vi 查看 vim 编辑 rpm -qa|grep jdk 命令查看当前的jdk情况 yum -y remove java java-1.7.0-openjdk* ...
- c#进阶之泛型
好久没用写博了,感觉工作的越久就越发的懒了,啦啦啦!德玛西亚! 感觉最近食欲不正,便想写写组织下自己的学习路程: 泛型,可能很多朋友在学习这个东西的时候都源于面向对象,当然我也不例外:从一个实体继承另 ...
- clean exit - waiting for changes before restart
在使用nodemon的时候,针对于同一个文件一次使用还好,当多次使用的时候就会出现这样的情况: 解决办法: nodemon clean exit 原因: 可能是因为缓存造成的:
- Sql Server语句大全
T-SQL语句大全 --跳转到SQL myDemo USE [SQL myDemo] go --声明变量id declare @id int --为变量赋值:直接赋值 --将cid为3的cname值赋 ...