<script type="text/javascript">
var score =80; //score變量存儲成績,初值為80
if(score>=60)
{
document.write("很棒,成績及格了。");
}
else
{
document.write("加油,成績不及格。");
}
</script>
var score =80; //score變量存儲成績,初值為80
if(score>=60)
{
document.write("很棒,成績及格了。");
}
else
{
document.write("加油,成績不及格。");
}
</script>
2016-03-02
document.write("I love");
document.write("javascript");
document.write("javascript");
2016-03-02
var mychar="I love imooc";
alert(mychar);
alert("我愛慕課網");
alert(mychar);
alert("我愛慕課網");
2016-03-02
<script type="text/javascript">
document.write("hello");
document.getElementById("p1").style.color="blue";
</script>
document.write("hello");
document.getElementById("p1").style.color="blue";
</script>
2016-03-02
<script>
var mystr="我是";
var mychar="慕課網";
document.write(mystar+mychar+"的忠實粉絲?。?amp;quot;);
</script>
var mystr="我是";
var mychar="慕課網";
document.write(mystar+mychar+"的忠實粉絲?。?amp;quot;);
</script>
2016-03-02
<script type="text/javascript">
document.write("hello");
document.getElementById("p1").style.color="blue";
</script>
document.write("hello");
document.getElementById("p1").style.color="blue";
</script>
2016-03-02
<script type="text/javascript>
document.write("開啟JS之旅!");
</script>
document.write("開啟JS之旅!");
</script>
2016-03-02
document.write("hello");
document.getElementById("p1").style.color="blue";
document.getElementById("p1").style.color="blue";
2016-03-02
<scrip type="text/javascript">
documen.write("hello");
document.getElementByld("p1").style.color="blue";
</script>
documen.write("hello");
document.getElementByld("p1").style.color="blue";
</script>
2016-03-02
function hidetext()
{
var mychar=document.getElementById("con");
style.display="none";
}
function showtext()
{
var mychar=document.getElementById("con");
style.display="block";
}
{
var mychar=document.getElementById("con");
style.display="none";
}
function showtext()
{
var mychar=document.getElementById("con");
style.display="block";
}
2016-03-01