const inhtml = document.getElementById('problem_text').innerHTML.replace('この白を探せ!<br>#', 'col_'); const el = document.getElementsByClassName("alternatives"); let idd = ''; for( let i = 0 ; i < el.length ; i ++ ) { idd=el[i].getAttribute("id"); if(inhtml == idd){ var clickMe = document.getElementById(idd); if( /*@cc_on ! @*/ false ) { clickMe.fireEvent("onclick"); } else { var event = document.createEvent( "MouseEvents" ); event.initEvent("click", false, true); clickMe.dispatchEvent(event); } } }