カテゴリー:
CSS
閲覧数:429 配信日:2019-10-13 12:27
class名
const classList = Array.prototype.reduce.call(document.querySelectorAll('[class]'), (classList, element) => (Array.prototype.push.apply(classList, element.classList), classList), []);
//console.log(classList);
console.log(JSON.stringify(classList,null,'\t'));
//console.log(classList);
console.log(JSON.stringify(classList,null,'\t'));
[
"hp",
"vasq",
"big",
"ctr-p",
"gb_Tf",
"gb_Ka",
"gb_Bg",
"gb_g",
"gb_Ag",
"gb_Eg",
"gb_Tf",
"gb_ce",
"gb_g",
"gb_Bg",
"gb_sg",
"gb_f",
"gb_g",
"gb_e",
"gb_f",
"gb_g",
"gb_e",
"gb_Zc",
"gb_Bg",
"gb_g",
"gb_A",
"gb_hd",
"gb_g",
"gb_Lf",
"gb_B",
"gb_sc",
"gb_Ra",
"gb_Qa",
"gb_mg",
"gb_g",
"gb_Lf",
"gb_de",
"gb_1",
"gb_pb",
"gb_Ra",
"gb_Qa",
"jhp",
"big",
"sfbg",
"nojsv",
"sfbgg",
"tsf",
"nj",
"A8SBwf",
"RNNXgb",
"SDkEP",
"iblpc",
"uFMOof",
"nS8rZ",
"z1asCe",
"MZy1Rb",
"a4bIc",
"vdLsw",
"gsfi",
"gLFyf",
"gsfi",
"dRYYxd",
"JC0tCe",
"hb2Smf",
"UUbT9",
"RjPuVb",
"aajZCb",
"xtSCL",
"erkvQe",
"sbct",
"suggestions-inner-container",
"sbic",
"sbtc",
"sbl1",
"sbab",
"sbai",
"VlcLAe",
"gNO89b",
"RNmpXc",
"JUypV",
"y",
"yp",
"duf3",
"aciXEb",
"FPdoLc",
"VlcLAe",
"gNO89b",
"RNmpXc",
"spch-dlg",
"spch",
"s2fp-h",
"close-button",
"spchc",
"inner-container",
"button-container",
"r8s4j",
"button",
"microphone",
"receiver",
"wrapper",
"stem",
"shell",
"text-container",
"spcht",
"spcht",
"google-logo",
"permission-bar",
"permission-bar-gradient",
"content",
"ctr-p",
"ctr-p",
"EvHmz",
"hRvfYe",
"fbar",
"b2hzT",
"b0KoTc",
"Q8LRLc",
"Fx4vi",
"Fx4vi",
"Fx4vi",
"Fx4vi",
"Fx4vi",
"Fx4vi",
"Fx4vi",
"gb_va",
"csi"
]
id名
const idList = Array.prototype.map.call(document.querySelectorAll('[id]'), element => element.id);
console.log(idList);
console.log(idList);
(41) ["gsr", "gstyle", "viewport", "doc-info", "cst", "gb", "gbw", "gbwa", "gb_70", "searchform", "tsf", "tophf", "sbt", "duf3-46", "sbfblt", "spch-dlg", "spch", "spchx", "spchc", "spchl", "spchb", "spchi", "spchf", "main", "body", "lga", "hplogo", "prm-pt", "swml", "footer", "fbarcnt", "footcnt", "fbar", "fsr", "fsettl", "fsett", "dk2qOd", "fsl", "footc", "xfoot", "lb"]
・連想配列をコンソールで深い階層の中身も全部表示する