coffeescript循环迭代标签列表中的标签

时间:2017-12-14 15:41:52

标签: javascript coffeescript

我无法让它发挥作用。

students = ["nova", "alexander", "johnathan", "amanda"]
classColors = ["red", "orange", "yellow", "green", "purple", "blue"]
h1Tags = [] # h1 tag generator
countTags = []
for color in classColors
  for room in rooms
    h1Tags.push("##{color}-#{room}-h1")
    countTags.push("##{color}-#{room}-count")


populateChildCount = ->
# work in progress
  for tag in h1Tags
    for count in countTags
      $(tag).text $(count).children().length

我想将tag的文字更改为div id所具有的子项数量。

0 个答案:

没有答案