社区
JavaScript
帖子详情
如何得到iframe里的一个元素的值?
zsuwwj
2003-01-25 06:24:51
例如:
<IFRAME src="editor.htm" name=iEditor width="100%" height="190">
</IFRAME>
在editor.htm里有一个sContent的变量,如何得到它的值?
...全文
29
3
打赏
收藏
如何得到iframe里的一个元素的值?
例如: 在editor.htm里有一个sContent的变量,如何得到它的值?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
3 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
zsuwwj
2003-01-26
打赏
举报
回复
谢谢!
请问如何给分啊?
ssm1226
2003-01-26
打赏
举报
回复
index.htm
<IFRAME src="editor.asp" name=iEditor width="100%" height="190">
</IFRAME>
<INPUT type="button" value="显示text控件值" id=button1 name=button1 onclick="alert(iEditor.document.all.txt.value)">
<br>
<INPUT type="button" value="显示变量值" id=button2 name=button2 onclick="alert(iEditor.name)">
----------------------------------------------------------------------
editor.htm
<script language=javascript>
var name="ssm1226";
</script>
<input type=text name=txt value="ssm1226">
saucer
2003-01-25
打赏
举报
回复
use frames['iEditor'].sContent, for example
1.editor.htm:
<script language="javascript">
sContent= 999;//this makes sContent part of window
</script>
<input id="txt1" value="123">
2. frame.htm:
<IFRAME src="editor.htm" name=iEditor width="100%" height="190">
</IFRAME>
<input type="button" value="get iframe variable" onclick="alert(frames['iEditor'].sContent)">
<input type="button" value="get iframe value" onclick="alert(frames['iEditor'].document.all('txt1').value)">
HTML基础入门视频课程
本课程从零开始,以通俗易懂的方式讲解HTML技术,手把手教你掌握每一个知识点。课程中使用的所有英文单词都会逐一查询并记录,真正做到零基础入门学习,适合初学者的教程! 课程内容包括: 1.HTML简介、文档结构 2....
如何获得
iframe
中元素的
值
?
我在一个页面嵌入了
iframe
,并且我想获得这个
iframe
页面某
个元素
的
值
。那么该如何实现这个需求呢? 先来看下演示: 效果演示
iframe
1中文本框的
值
: 在IE下操作
IFrame
内容的代码: 1 document.frames...
html如何获取
iframe
中嵌套的页面元素
值
,在javascript中嵌套在Frame内的
iframe
中获取元素
值
?...
我想从第一帧访问
iframe
文档中的元素
值
.我试过这样的:var frame1 = parent.frames[1];var frame2 = frame1.document.getElementsByTagName('
iframe
')[0];var eleValue =frame2.contentWindow.document.getEleme...
php获取
iframe
里
面元素的
值
,用JavaScript获取
iframe
里
的
值
我在一个页面嵌入了
iframe
,并且我想获得这个
iframe
页面某
个元素
的
值
。那么该如何实现这个需求呢?先来看下演示:效果演示
iframe
1中文本框的
值
:在IE下操作
IFrame
内容的代码:document.frames["My
IFrame
"].document....
获得html页面的
iframe
,jquery如何获取
iframe
中的元素?
jquery如何获取
iframe
中的元素?下面本篇文章给大家介绍一下。有一定的参考价
值
,有需要的朋友可以参考一下,希望对大家有所帮助。jquery如何获取
iframe
中的元素?在父窗口中获取
iframe
中的元素方法1格式:$("#...
JavaScript
87,910
社区成员
224,616
社区内容
发帖
与我相关
我的任务
JavaScript
Web 开发 JavaScript
复制链接
扫一扫
分享
社区描述
Web 开发 JavaScript
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章