例如:
我点击一个按钮。 div 正在改变一些东西
$('#change').click(function(){ //the button
$('#myframe').contents().find('#makeit').css("do Someting") //the div in a frame
});
到目前为止我已经明白了。
我需要知道,如何执行 execCommand (可能像“bold”)而不是 .css() 方法?
最佳答案
我找到了答案here .
就我而言(jQuery)。看起来像
$('#change').click(function(){
document.getElementById("myframe").contentWindow.document.execCommand('bold', false, null);
});
关于jquery - 如何使用 jQuery 在 iFrame 中执行 "execCommand"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13583124/