Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想用 jquery 计算具有特定 ID 的元素。我的应用程序具有具有多行的块,这些行具有多个字段。
我的字段有这样的 id:“field_B1_L1_1”,这将是第一行的第一个字段。计算所有块中的所有字段很容易:
$(":input[id^=field]").length
但是,如果我想从块 x 计算行 y 中的所有字段,我该怎么办?
$(":input[id^=field_B{x}_L{y}]").length how can i put the variables in here?