JS函数赋值给ID显示出来 255
<iframename="ifr"id="ifr"src="b.html"></iframe><inputtype="button"value="点击"onclick="...
<iframe name="ifr" id="ifr" src="b.html">
</iframe>
<input type="button" value="点击" onclick="aaa();"/>
<div id="demo"></div>
<script type="text/javascript">
function aaa()
{
alert(window.frames["ifr"].document.getElementById("div1").innerHTML);
}
</script>
现在这段代码是点击之后才会显示AAA的值,帮我改成demo直接显示aaa的值。谢谢 展开
</iframe>
<input type="button" value="点击" onclick="aaa();"/>
<div id="demo"></div>
<script type="text/javascript">
function aaa()
{
alert(window.frames["ifr"].document.getElementById("div1").innerHTML);
}
</script>
现在这段代码是点击之后才会显示AAA的值,帮我改成demo直接显示aaa的值。谢谢 展开
1个回答
展开全部
var quiz = ["gay?yesno
",
"lesbian?yesno
",
"sex?malefemale
"]
var f = document.getElementsByName("ga");
var s = document.getElementsByName("le");
var t = document.getElementsByName("se");
function checkanswer() {
if (f.length) {
if ((f[0].checked == true)) {
document.getElementById("a").innerText = "correct";
}
else document.getElementById("a").innerText = "the answer should be yes";
}
if (s.length) {
if ((s[0].checked == true)) {
document.getElementById("b").innerText = "correct";
}
else document.getElementById("b").innerText = "the answer should be yes";
}
if (t.length) {
if ((t[0].checked == true)) {
document.getElementById("a").innerText = "correct";
}
else document.getElementById("a").innerText = "the answer should be male";
}
}
",
"lesbian?yesno
",
"sex?malefemale
"]
var f = document.getElementsByName("ga");
var s = document.getElementsByName("le");
var t = document.getElementsByName("se");
function checkanswer() {
if (f.length) {
if ((f[0].checked == true)) {
document.getElementById("a").innerText = "correct";
}
else document.getElementById("a").innerText = "the answer should be yes";
}
if (s.length) {
if ((s[0].checked == true)) {
document.getElementById("b").innerText = "correct";
}
else document.getElementById("b").innerText = "the answer should be yes";
}
if (t.length) {
if ((t[0].checked == true)) {
document.getElementById("a").innerText = "correct";
}
else document.getElementById("a").innerText = "the answer should be male";
}
}
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询