0
<div class="yui-gd">
<div class="yui-u first"><label for="${args.htmlid}-addContent">${msg("label.HowToAddContent")}:</label></div>
<div class="yui-u">
<select id="addContent" name="addContent" onchange="dropdown(this)">
<option value="1" selected="selected">${msg("label.generateFromDescription")}</option>
<option value="2">${msg("label.uploadFile")}</option>
</select>
</div>
</div>
<script type="text/javascript">//<![CDATA[
function dropdown(sel){
//if(document.getElementById("addContent").value == "1")
if(sel.value == "0"){
document.getElementById('desc').style.display = 'block'
}
else {
document.getElementById('desc').style.display = 'none'
}
}
//]]></script>
私は、選択ボックスにイベントハンドラを追加したいので書きますが、Firefoxではうまくいきますが、IEでは常にnull例外がスローされます。 attachEventを使用しても、IEではまだ動作しません。 上記でdocument.getElementById( "addContent")を使用すると、常にnull例外がスローされます。 しかし、これらのすべてがFirefoxでうまくいきます!alfresco ----サーフテンプレートにイベントハンドラを追加する方法?
誰かが私にその理由を教えてもらえますか? ありがとうございます!