使用Javascript按Div Value过滤HTML表格? [英] Filter HTML table by Div Value with Javascript?
本文介绍了使用Javascript按Div Value过滤HTML表格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,
我正在尝试使用javascript按div值过滤HTML表格。
这是HTML格式的表格:
展开 | 选择 | Wrap < span class =codeDivider> | 行号
解决方案
< blockquote>你可以做到。但用div做这件事有点复杂。将div的值设置为tr,因为它的ID如下所示。
Ex:
展开 | 选择 | Wrap | 行号
一些注释:
- 无需使用< div>在所有
- 值属性仅对输入/选项元素有效
- align 可以替换为CSS
@ RamananKalirajan
- 第2行:你得到 document.getElementById(''mySelect'')。value ( .value 是每个表单控件元素的属性)
非常感谢您对此事的反馈和帮助。我似乎遇到了一些错误。例如,即使我将最小值设置为200,像这样的表行显示:
展开 | 选择 | Wrap | 行号
Hello,
I am trying to filter an HTML table by div value using javascript.
Here is my table in HTML:
Expand|Select|Wrap|Line Numbers解决方案You can do it. But doing it with div is little bit complicated. Set the value of the div to the tr as it''s id like below.
Ex:
Expand|Select|Wrap|Line Numbers
some annotations:
- there is no need to use <div> at all
- the value attribute is valid only for input/option elements
- align can be replaced by CSS
@ RamananKalirajan
- line #2: you get the same with document.getElementById(''mySelect'').value (.value is a property of every form control element)
Thanks very much for your feedback and assistance on this matter. I seem to be encountering some errors with it. For instance, even when I set my minimum value to 200, table rows like this one show:
Expand|Select|Wrap|Line Numbers
这篇关于使用Javascript按Div Value过滤HTML表格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文登录 关闭
扫码关注1秒登录发送“验证码”获取 | 15天全站免登陆