遇到了js无法获得动态添加的标签的值,百度了一番,最后自己解决了问题,但是原理现在还不怎么明确。

$("input[id='txtAttValue']").each(function (i) {
      if ($(this).val().trim() == "") {
      $("span[id='error']").eq(i).css("display", "block");
      }
});

好像也只有$("span[id='error']")这种写法能获取动态添加标签的值,其他写法都很郁闷的没反应。

相关文章:

  • 2022-12-23
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-06
  • 2021-10-02
猜你喜欢
  • 2021-11-23
  • 2021-07-13
  • 2021-10-06
  • 2022-12-23
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案