2017-09-11 13 views

答えて

0

ボタンのコレクションを繰り返してCSSの表示プロパティをブロックに変更すると、問題が解決されます。

findButtonbyTextContent("text to find"); 

function findButtonbyTextContent(text) { 
    var buttons = document.querySelectorAll('button'); 
    for (var i=0, l=buttons.length; i<l; i++) { 
       if (buttons[i].firstChild.nodeValue == text){ 
        buttons[i].style.display = "block"; 
       } 
    } 
} 
関連する問題