エディターに関するよくある質問
1. ビジュアルエディターの操作
同じ要素を一括変更する方法


2. コードエディターの操作
(1)オリジナルとバリエーション両方にJavascriptを適用したい


(2)正規表現を活用してトラッキング設定したい



Last updated







Last updated
const regex = /button/;
// Function to be executed when the regex matches an element
function regexMatchHandler(event) {
console.log('Regex match found!');
console.log('Matched element:', event.target);
ABTastyClickTracking('GOAL_NAME');
}
// Use querySelectorAll to find all elements on the page
const allElements = document.querySelectorAll('*');
// Loop through each element and check if the regex matches the id
allElements.forEach(element => {
if (regex.test(element.id)) {
element.addEventListener('click', regexMatchHandler);
}
});