使用Jquery从表中获取单元格值?

时间:2016-09-07 18:07:04

标签: javascript jquery html-table

我正在尝试从另一个PHP代码生成的HTML表中获取单元格值。我可以使用结果在最终用户发送集合点。

我当前的JSFiddle可以获取一些值,但不是我想要的。我需要检索attrib title&来自TD按钮的value,我的问题是当前代码从早晨返回数据并跳转到第二天早上。

如何返回value&表格中每个可用日期的title数据?

代码:

$(document).ready(function(){      

  eachCell();

  function eachCell(){
    var cellInnerText = [];
    var cellValue = [];
    var out = document.getElementById("out");
    var out2 = document.getElementById("out2");
    $('#ft_agenda tbody tr').each(function(index) {        
        // console.log("index ", index, " this: " , this, "this.attr(rel)", $(this).attr('rel'), "$(this).text()", $(this).text());
        console.log($(":first-child", $(this))[0]);
        cellInnerText.push($("td button", $(this)).attr('value'));
        cellValue.push($("td button", $(this)).attr('title'));
    });
    out.innerHTML = cellInnerText.join(" | ");
    out2.innerHTML = cellValue.join(" | ");    
}

});

1 个答案:

答案 0 :(得分:1)

Key extra is a duplicate in ./composer.json at line 94
ComposerHookHandler::onPreUpdate
Deprecation Notice: The Composer\Package\LinkConstraint\VersionConstraint class is deprecated, use Composer\Semver\Constraint\Constraint instead. in phar:///home/budrysl2/domains/westeros.com.pl/public_html/composer.phar/src/Composer/Package/LinkConstraint/VersionConstraint.php:17

Deprecation Notice: The Composer\Package\LinkConstraint\LinkConstraintInterface interface is deprecated, use Composer\Semver\Constraint\ConstraintInterface instead. in phar:///home/budrysl2/domains/westeros.com.pl/public_html/composer.phar/src/Composer/Package/LinkConstraint/LinkConstraintInterface.php:17

Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- The requested package mediawiki/mediawiki-codesniffer 0.5.0 is satisfiable by mediawiki/mediawiki-codesniffer[v0.5.0] but these conflict with your requirements or minimum-stability.
Problem 2
- The requested package mediawiki/mediawiki-codesniffer 0.5.0 is satisfiable by mediawiki/mediawiki-codesniffer[v0.5.0] but these conflict with your requirements or minimum-stability.
Problem 3
- The requested package mediawiki/mediawiki-codesniffer 0.4.0 is satisfiable by mediawiki/mediawiki-codesniffer[v0.4.0] but these conflict with your requirements or minimum-stability.
Problem 4
- The requested package mediawiki/mediawiki-codesniffer 0.4.0 is satisfiable by mediawiki/mediawiki-codesniffer[v0.4.0] but these conflict with your requirements or minimum-stability.