html中删除表格的一行(有弹窗)

html中删除表格一行其实很简单,但是加上一个提示弹窗后,点击确定后却获取不到要删除的是哪一行,下面是一个demo

html:

<tr>
							<td>
								<input type="checkbox" class="checkBig" />
							</td>
							<td>安徽车乐优</td>
							<td>13888888888</td>
							<td>安徽省合肥市政务区金寨路与潜山路交口金潜广场</td>
							<td>门店</td>
							<td>
								<div class="opo">
									<div class="modify">修改</div>
									<div class="delete"  οnclick="shanchu(this)">删除</div>
								</div>
							</td>
						</tr> 

弹窗:

<!--删除-->
		<div class="delcon">
			<div class="desure">确认删除?</div>
			<div class="delfoot">
				<div class="delcer">确认</div>
				<div class="delcan">取消</div>
			</div>
		</div>

弹窗css:

.delcon{
	width: 30%;
	overflow: hidden;
	background: #fff;
	box-sizing: border-box;
	border: 5px solid #3eb4c5;
	position: fixed;
	left: 33%;
	top: 20%;
	z-index: 999;
	display: none;
}
.desure{
	width: 100%;
	height: 35px;
	line-height: 35px;
	text-align: center;
	margin-top:45px;
	margin-bottom: 30px;
}
.delfoot{
	width: 100%;
	height: 35px;
	margin-bottom: 20px;
}
.delcer{
	float: left;
	margin-left: 20%;
	width: 80px;
	height: 35px;
	line-height: 35px;
	text-align: center;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	background: #3eb4c5;
	cursor: pointer;
}
.delcan{
	float: left;
	margin-left: 15%;
	width: 80px;
	height: 35px;
	line-height: 35px;
	text-align: center;
	color: #383838;
	font-size: 12px;
	/*font-weight: 700;*/
	box-sizing: border-box;
	border:1px solid #C3C3C3
	 /*background: #3eb4c5;*/;
	cursor: pointer;
}

  js;

//删除
		function shanchu (obj){
			$('.delcon').fadeIn()
//			//确定
			$('.delcer').click(function(event){
				$(obj).parent().parent().parent().remove();
				$('.delcon').fadeOut()	
			})
			//取消
			$('.delcan').click(function(event){
				$('.delcon').fadeOut()	
			})
		}

  

 

转载于:https://www.cnblogs.com/xinheng/p/9679122.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值