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

JavaScript入门篇

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

最新回答 / 石塘一枝花
用emoveAttribute就可以了,function  cancle(){    var str=confirm("你确定要取消修改设置吗");    if(str)       document.getElementById("txt").removeAttribute("style")

已采纳回答 / 20160101cui
  function hidden(){        first.style.display="none";        second.style.display="none";    }<...图片...>
function openWindow(){
if(confirm(&quot;是否打开新窗口?&quot;)){
var site=prompt(&quot;请输入要打开的网:&quot;,&quot;http://www.imooc.com/&quot;);
if(site!=null){
window.open(site,&#039;_blank&#039;,&#039;width=400,height=500,menubar=no,toolbar=no&#039;);
}
}
}
很棒的,比死板教学的强多多了
backgroundColor的C要大写才能使能背景颜色生效
我就问问removeAttribute()哪一节有讲?
function openWindow()
{ var ensure=confirm(&quot;是否打开?&quot;);
if(ensure==true)
{var test=prompt(&quot;请输入网址&quot;,&quot;www.imooc.com&quot;);
window.open(&#039;test&#039;,&#039;_blank&#039;,&#039;width=400,height=500,top=100,toolbar=no,menubar=no&#039;); }
else
{document.write(&quot;一边玩去&quot;);}
}
觉得很适合我这种基础不好的
//清除样式
function set(){
var tips = confirm(&#039;是否取消设置&#039;);
if(tips==true){
el.style=&#039;&#039;;
el1.style=&#039;&#039;;
}
}
&lt;script type=&quot;text/javascript&quot;&gt;
var mychar= document.getElementById(&quot;con&quot;);
document.write(&quot;原标题:&quot;+mychar.innerHTML+&quot;&lt;br&gt;&quot;); //输出原h2标签内容
mychar.innerHTML = &quot;Hello World!&quot;;
document.write(&quot;修改后的标题:&quot;+mychar.innerHTML); //输出修改后h2标签内容
&lt;/script&gt;
声明一下,这个不是BUG,而是因为有些东西比较开放,不定义正确答案,至于你的代码是否正确你可以用DW测试一下
onClick =&quot; gaibiankuangao()&quot;&gt;
function gaibianyanse()
{
var text = document.getElementById(&quot;txt&quot;);
text.style.color = &quot;red&quot;;
text.style.backgroundColor = &quot;#ccc&quot;;
}
function gaibiankuangao()
{
var text = document.getElementById(&quot;txt&quot;);
text.style.width = &quot;300px&quot;;
text.style.height = &quot;200px&quot;;
}

已采纳回答 / 111114
貌似没有错   
&lt;script type=&quot;text/javascript&quot;&gt;
function openWindow(){
var lwq=confirm(&quot;确认打开新建窗口吗?&quot;);
if(lwq==true)
{
window.open(&#039;url&#039;,&#039;http://www.imooc.com/&#039;,&#039;width=400px,height=500px,menubar=no,toolbar=no&#039;);
}
else
{
window.clos();
}
}
&lt;/script&gt;
Nice,你这是年薪过百万的节奏啊!下一节吧。
function openWindow(){
var myconfirm=confirm(&quot;是否打开?&quot;);
if(myconfirm==true){myurl();}
}
function myurl(){var myopen=prompt(&quot;请输入网址&quot;,&quot;http://www.imooc.com/&quot;);if(myopen!=null){mywidiow();}}
function mywidiow(){window.open(&#039;myopen&#039;,&#039;_blank&#039;,&#039;width=400&#039;,&#039;height=500&#039;,&#039;menubar=no&#039;,&#039;toolbar=no&#039;);}
课程须知
该课程是针对新手的一个简单基础的课程,让您快速了解JS,通过一些简单的代码编写体会JS。如果您已经对JS有所了解,可以跳过本课程,学习JS进阶课程,进一步学习JS相应的基础知识。学习本课程,希望您至少具备HTML/CSS基础知识,认识常用的标签。
老师告诉你能学到什么?
1. 理解JavaScript基础语法; 2. 掌握常用语句的使用方法; 3. 学会如何获取DOM元素及进行简单操作。

微信扫码,参与3人拼团

微信客服

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

帮助反馈 APP下载

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

公众号

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

友情提示:

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

本次提问将花费2个积分

你的积分不足,无法发表

为什么扣积分?

本次提问将花费2个积分

继续发表请点击 "确定"

为什么扣积分?

举报

0/150
提交
取消