Getting value of ID from class
问题 How is it possible to get the value of ID from class using google tag manager? <html> <body> <textarea id='5' class='cp _check'>sometexthere</textarea> </body> <html> Using JQuery it is possible with this: $(".cp._check").attr("id") 回答1: Go to variables, select new, type DOM. Select CSS selector. You can then use selectors similarly to jQuery: Even though there might be multiple matches for your selector GTM retrieves the value for the first occurence only. 回答2: I guess you should use