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

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -