JS中区分大小写,如变量mychar与myChar是不一样的,表示是两个变量。
变量虽然也可以不声明,直接使用,但不规范,需要先声明,后使用。
                变量虽然也可以不声明,直接使用,但不规范,需要先声明,后使用。
                    
                    2014-12-25
                
            单行注释,在注释内容前加符号 “//”
多行注释以"/*"开始,以"*/"结束。
                多行注释以"/*"开始,以"*/"结束。
                    
                    2014-12-25
                
            不知道对不对?
<input type="button" onclick="unset()" value="取消设置" >
var mychar=document.getElementById("con");
function unset{
var str=confirm("是否要取消所有设置");
if(str=true){
mychar.innerHTML=document.getElementById("txt");
}
}
                
            <input type="button" onclick="unset()" value="取消设置" >
var mychar=document.getElementById("con");
function unset{
var str=confirm("是否要取消所有设置");
if(str=true){
mychar.innerHTML=document.getElementById("txt");
}
}
<script type="text/javascript">
function add(){
var p1 = document.getElementById("p1");
p1.className="one";
}
function modify(){
var p2 = document.getElementById("p2");
p2.className="two";
}
                function add(){
var p1 = document.getElementById("p1");
p1.className="one";
}
function modify(){
var p2 = document.getElementById("p2");
p2.className="two";
}
                    
                    2014-12-24
                
            第一条代码是 I LOVE 第二条是  JAVASCRIPT   由于解读顺序,依次解读。故, 显示的是  I LOVE JAVASCRIPT
                
                    
                    2014-12-21
                
            function openWindow(){
var mycar=confirm("确定在新窗口中打开页面吗?");
if(mycar==true){
window.open('http://www.imooc.com','_blank','width=400,height=500,menubar=no,toolbar=yes')
}else{
document.write("嗨,朋友")
};
}
                
            var mycar=confirm("确定在新窗口中打开页面吗?");
if(mycar==true){
window.open('http://www.imooc.com','_blank','width=400,height=500,menubar=no,toolbar=yes')
}else{
document.write("嗨,朋友")
};
}