簡單的JavaScrpit 筆記,怕以後會忘記,所以做個小筆記,方便備查! 詳情請入內
顯示結果如下:
a = "37" + 7 = 377
b = 37 + 7 = 44
p = "37" - 7 = 30
q = 37 - 7 = 30
x = 168 + "abc" = 168abc
y = "abc" + 168 = abc168
語法如下:
<Script>
var a = "37"+7;
var b = 37+7;
var p = "37"-7;
var q = 37-7;
var x = 168 + "abc";
var y = "abc" + 168;
document.write("a = \"37\" \+ 7 = " + a + "<P>");
document.write("b = 37 \+ 7 = " + b + "<P>");
document.write("p = \"37\" - 7 = " + p + "<P>");
document.write("q = 37 - 7 = " + q + "<P>");
document.write("x = 168 + \"abc\" = " + x + "<P>");
document.write("y = \"abc\" + 168 = " + y + "<P>");
</Script>
留言列表