// 生成隨機字符串的函數
function generateRandomString(length) {
const characters = 'abcdefghijklmnopqrstuvwxyz0123456789';
let result = '';
for (let i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() * characters.length));
}
return result;
}
// 為所有 div 元素添加隨機字符串
document.querySelectorAll('div').forEach(div => {
const randomString = generateRandomString(3); // 生成3個字符的隨機字符串
div.classList.add(randomString);
});