xul を使用して Firefox にツールバー ボタンを追加しましたが、JavaScript でそのツールバー ボタンの背景色を変更したいと考えています。誰でも助けてください
私のxulボタンコードは次のとおりです。
<toolbox id="navigator-toolbox">
<toolbar id="TutTB-Toolbar" toolbarname="Tutorial Toolbar" accesskey="T"
class="chromeclass-toolbar" context="toolbar-context-menu"
hidden="false" persist="hidden">
<toolbaritem flex="0">
<toolbarbutton id="TutTB-Web-Button" tooltiptext="Search"
label="button" oncommand="alert('ok');" />
</toolbaritem>
<toolbarspring />
</toolbar>
</toolbox>
そして、次のコード行を介してjavascriptでアクセスしようとします
var p = document.getElementById("TutTB-Web-Button");
alert(p.textContent);
document.getElementById("TutTB-Web-Button").style.backgroundColor='red';