私は面白いために作っているWYSIWYGエディタの一部として編集可能なIframeを持っています。私は、ボタンが押されたときにエディタでの入力を無効にしたいと思っています。ここに私のコードです:iframeのテキストエリアを無効にする
<a class="buttonOnBar_break" id="btn1" type="button" value="" onClick="javascript:iBold();" title="Bold text"><img id="btnOnBarImg"src="img/icons/bold.png"></a>
<textarea style="display:none;"id="postTextStyle" name="Text" cols="100" rows="14" wrap="hard" ><?php echo $text;?></textarea>
<center><iframe name="richTextField" id="richTextField" ><?php echo $text;?></iframe></center>
<script>
function iBold(){
document.getElementById("richTextField").disabled = true;
}
</script>
これは私のためには動作しません。私は1時間半のインターネットを検索して解決策を見つけようとしていますが、私が試したことのすべてはうまくいかないのです。これも可能ですか?
を編集する必要があります – Steven