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

JavaScript入门篇

难度入门
时长 1小时35分
学习人数
综合评分9.57
5511人评价 查看评价
9.8 内容实用
9.5 简洁易懂
9.4 逻辑清晰

已采纳回答 / eagle_thr
style:样式风格。主要指代HTML标签内容中的颜色,字体,大小等css样式。<h style="font-size:10px;font-color:red">innerhtml</h>type:HTML元素类型。<input type="button" value="button name" onclick="function()" />
var mychar = document.getElementById(&quot;con&quot;);
mychar.style.display=&quot;none&quot;;

var mychar = document.getElementById(&quot;con&quot;);
mychar.style.display=&quot;block&quot;;
或者
var mychar = document.getElementById(&quot;con&quot;).style.display=&quot;none&quot;;
var mychar = document.getElementById(&quot;con&quot;).style.display=&quot;block&quot;;
神奇的JS,快把我们隐藏了!
这句话不显示啊

最新回答 / eagle_thr
alert('txt');用到了( )。因为alert()是一个函数(function)。( )里面为参数。var obj=document.getElementById('idName');obj.style.color='red';obj.style.height=40;用到了' '(' '与 “ ”这里等价)。因为这里不是调用函数,而是给HTML元素对象的属性赋值。

最新回答 / Summer1987
已经找到错误,太多了,以后还有仔细再仔细,谢谢各位的浏览

已采纳回答 / bingovhh
function window()--定义函数名是window,在button调用function的时候是onlick="openWindow()",首先是调用名称不对,其次是函数名字不能使用window,window应该属于javascript的内置对象var url=prompt("请输入网址","http://www.imooc.com"); 参数中间的 逗号为中文字符,编译不过去if(url=="http://www.imooc.com ")   'com'后面明显有空格window.close(...
function Wopen(){
var x=confirm(&quot;是否新建窗口?&quot;);
if(x==true)
{var t=prompt(&quot;请输入网址&quot;,&quot;http://www.imooc.com&quot;);
if(t==&quot;http://www.imooc.com&quot;)
{window.open(&#039;http://www.imooc.com&#039;,&#039;_self&#039;,&#039;width=400,height=500,menubar=no,toolbar=no,status=no,scrollbars=yes&#039;)}
else{alert(&quot;输入错误&quot;);}}
else{alert(&quot;不输网址,你点进来干毛线&quot;);}}
function openWindow(){
var sureOpen = confirm(&quot;openWindow?&quot;);
var openLink = prompt(&quot;open what link?&quot;, &quot;http://www.imooc.com/&quot;);
if(sureOpen === true){
window.open(openLink, &quot;_blank&quot;, &quot;width=400, height=500, toolbar=no, scroolbars=no&quot;);
}};

已采纳回答 / qq_化简_0
一般浏览器都有恢复默认设置的功能,我的chrom浏览器,在settings -> advance setting -> reset settings
function openWindon(){
if(confirm(&quot;确定打开新窗口吗?&quot;)){
var url = prompt(&quot;请输入一个网址&quot;,&quot;http://www.imooc.com/&quot;);
window.open( url,&quot;_blank&quot;,&quot;toolbar=no, menubar=no, scrollbars=yes, width=400, height=400&quot;);
}
}

最新回答 / pencrol
取消设置的函数将前面的函数包在里面
function openWindow()
{
var a=confirm(&quot;是否打开网站&quot;);
if(a==true)
{
window.open(&#039;www.imooc.com&#039;,&#039;_blank&#039;,&#039;width=400&#039;,&#039;height=500&#039;,&#039;menubar=no&#039;,&#039;toolbar=no&#039;)
}
else
{
document.write(&quot;不打开新窗口&quot;);
}
}
草泥马。照到人家代码写过来都不对
课程须知
该课程是针对新手的一个简单基础的课程,让您快速了解JS,通过一些简单的代码编写体会JS。如果您已经对JS有所了解,可以跳过本课程,学习JS进阶课程,进一步学习JS相应的基础知识。学习本课程,希望您至少具备HTML/CSS基础知识,认识常用的标签。
老师告诉你能学到什么?
1. 理解JavaScript基础语法; 2. 掌握常用语句的使用方法; 3. 学会如何获取DOM元素及进行简单操作。

微信扫码,参与3人拼团

微信客服

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

帮助反馈 APP下载

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

公众号

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

友情提示:

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

本次提问将花费2个积分

你的积分不足,无法发表

为什么扣积分?

本次提问将花费2个积分

继续发表请点击 "确定"

为什么扣积分?

举报

0/150
提交
取消