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

How do you change vbulletin's home page to the forums instead of the default (CMS or Activity Stream)? -

c++ - Troubles when compiling phash program -