如何查找动态创建的html表的'td'中存在的值 [英] how to find values present in 'td' of dynamically created html table

查看:61
本文介绍了如何查找动态创建的html表的'td'中存在的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在按钮点击时使用javascript在html表中添加值。然后我想在变量中获取它以检查它是否已经存在于表中...如何做到这一点?.. plz帮助..

i am adding values in html table on button click using javascript..then i want to fetch it in variable to check if it is already present in table or not...how to do it?..plz help..

推荐答案

看一下下面的例子,使用jQuery循环访问td单元格以检测与文本框重复的值。

Take a look at the following example using jQuery to loop through the td cells to detect value that duplicates that of the text box.
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
<script>


(document).ready( function(){
var textbox =
(document).ready(function(){ var textbox =


(#textbox1);
textbox.change(function(){
("#textbox1"); textbox.change(function() {


这篇关于如何查找动态创建的html表的'td'中存在的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆