为了账号安全,请及时绑定邮箱和手机立即绑定

JavaScript入门篇

难度入门
时长 1小时35分
学习人数
综合评分9.57
5511人评价 查看评价
9.8 内容实用
9.5 简洁易懂
9.4 逻辑清晰
<script type="text/javascript">
function rec(){
var str="你是傻瓜?";
var mymessage=confirm(str); ;
if(mymessage==true)
{
document.write("答对了,真聪明!");
}
else
{
rec();
}
}
</script>

最新回答 / aiyayo
好了,自己想明白了,如果要用tagname必须要在后边加索引
document.write(mychar+"<br/>")
document.write(mystr+mychar+"的忠实粉丝!")
document.write(mychar+"<br/>")
document.write(mystr+mychar+"的忠实粉丝!")

已采纳回答 / 啊啊啊啊123
<!DOCTYPE HTML><html><head><meta http-equiv="txttent-Type" txttent="text/html; charset=utf-8" /><title>javascript</title><style type="text/css">body{font-size:12px;}#txt{    height:400px;    width:600px; border:#3...
在body中设置好了p1 and p2的区域,分别用的head里的js,这是一个正常的HTML+CSS.练习中就是在原有基础上定义add函数和modify函数,用两个函数增加css和修改css,函数定义中用了className的方法

最赞回答 / 迷茫的人生3487123
两种方法解决: 1 <script>标签放在</body>标签和,</html>之间2加函数 Window.onload=function(){js代码}//页面加载完成后执行.
function openWindow()

{

var k_open;

var temp=confirm(&quot;是否要打开新的网页?&quot;);

if(temp)

{

k_open=prompt(&quot;请输入你要打开的网址:&quot;,&quot;http://www.imooc.com/&quot;);

window.open(k_open,&#039;_blank&#039;,&#039;width=400,height=500,menubar=no,toolbar=no&#039;);

}

}
God,你离成神已经不远了!

已采纳回答 / nnlzb66
  var box2    box2=prompt("打开以下网址:","http://www.imooc.com/")// 通过输入对话框,确定打开的网址,默认为 http://www.imooc.com/    if(box2==true)    {    window.open('http://www.imooc.com','_blank','width=400,height=500,,menubar=no,toolbar=no')//打开的窗口要求,宽400像素,高500像素,无菜单栏、无工具栏。...
var,document.write,if,else,alert,我只能默写这几个单词。
//定义&quot;取消设置&quot;的函数
function cancelSetup(){
if(confirm(&quot;确定要清空数据吗?&quot;)){
var mychar = document.getElementById(&quot;txt&quot;);
mychar.style.color=&quot;#000&quot;;
mychar.style.backgroundColor=&quot;#fff&quot;;
mychar.style.width=&quot;600px&quot;;
mychar.style.height=&quot;400px&quot;;
mychar.style.display=&quot;block&quot;;
}
}
//定义&quot;隐藏内容&quot;的函数
function hiddenContent(){
var mychar=document.getElementById(&quot;txt&quot;);
mychar.style.display=&quot;none&quot;;
}
//定义&quot;显示内容&quot;的函数
function displayContent(){
var mychar=document.getElementById(&quot;txt&quot;);
mychar.style.display=&quot;block&quot;;
}
&quot;改变颜色&quot;的函数
function changeColor(){
var mychar=document.getElementById(&quot;txt&quot;);
mychar.style.color=&quot;red&quot;;
mychar.style.backgroundColor=&quot;#ccc&quot;;
}
改变宽高&quot;的函数
function changeWH(){
var mychar=document.getElementById(&quot;txt&quot;);
mychar.style.width=&quot;400px&quot;;
mychar.style.height=&quot;100px&quot;;
}
为什么iPad只能下载视频课程啊
课程须知
该课程是针对新手的一个简单基础的课程,让您快速了解JS,通过一些简单的代码编写体会JS。如果您已经对JS有所了解,可以跳过本课程,学习JS进阶课程,进一步学习JS相应的基础知识。学习本课程,希望您至少具备HTML/CSS基础知识,认识常用的标签。
老师告诉你能学到什么?
1. 理解JavaScript基础语法; 2. 掌握常用语句的使用方法; 3. 学会如何获取DOM元素及进行简单操作。

微信扫码,参与3人拼团

微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

友情提示:

您好,此课程属于迁移课程,您已购买该课程,无需重复购买,感谢您对慕课网的支持!

本次提问将花费2个积分

你的积分不足,无法发表

为什么扣积分?

本次提问将花费2个积分

继续发表请点击 "确定"

为什么扣积分?

举报

0/150
提交
取消