欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

javascript自定義函數(shù)參數(shù)傳遞為字符串格式

 更新時間:2014年07月29日 10:05:00   投稿:whsnow  
本節(jié)主要介紹了通過自定義javascript函數(shù)傳遞參數(shù)為字符串格式的,用this傳遞、引號缺省,示例如下

自定義函數(shù)參數(shù)傳遞為 字符串格式 ,傳遞方式
1:用this傳遞
2:引號缺省
3:轉義字符(html中 " 代表"雙引號,'代表單引號,javascript中直接\" 和Java通用轉義字符集)

<html> 
<head> 
<script language="LiveScript"> 
function print(arg){ 
alert("你好!"+arg); 
} 
</script> 
</head> 
<body> 
<form> 
<input type="button" name="Button1" value="first" onclick="print(this.str)" str="你好one"> 
<br><br> 
<input type="button" name="button2" value="second" onclick=print("你好two")> 

<br><br> 
<input type="button" name="button3" value="Third" onclick="print (&quot你好three&quot)"> 

</form> 
</body> 
</html>

相關文章

最新評論