jqury 如何获取 kindeditor 中textarea 的值

获取文本内容,可是的创建时怎么也不能获取,利用FF的firebug查看到自己所写的内容在一个iframe中,于是想从iframe中获取文本,想要用
$(“ifame”).html();获取内容,可是依然不行,最终终于找到了解决方法,如下:
获取编辑器中的文本内容:
$(document.getElementsByTagName('iframe')[0].contentWindow.document.body).html();(注:这个试过可以)
以下是其他获取iframe的方法:
Js代码
$(document.getElementById('iframeId').contentWindow.document.body).htm()
显示iframe中body元素的内容。
Js代码
$("#testId", document.frames("iframename").document).html();
根据iframename取得其中ID为”testId”元素
Js代码
$(window.frames["iframeName"].document).find("#testId").html()

 

posted @ 2014-07-03 11:21  不负韶华668  阅读(371)  评论(0编辑  收藏  举报