replace class name with javascript -
i need finding element specific class name , replace new class name. here code came with. no results. class name not change, , there no errors in console.
updated code:
var classmatches = document.queryselectorall(".crux.attachflash"); (var = 0; < classmatches.length; i++) { classmatches[i].classname = " "; }
because need amend class-name of matched element, not array of elements:
var classmatches = document.queryselectorall(".crux.attachflash"); (var = 0; < classmatches.length; i++) { classmatches[i].classname = " "; } you forgot [i] index, trying set classname whole array (which, you've found, not work).
Comments
Post a Comment