<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>JsExample-9</title>
</head>
<script language=javascript src="Tools/prototype.js"></script>
<script type="text/javascript">
/*Function.prototype.bind = function(object) {
var __method = this;
return function() {
__method.apply(object, arguments);
}
}*/
</script>
<input type="text" id="aaa" value="1105" />
<input type="text" id="bbb" value="1105" />
<script type="text/javascript">
//document.getElementById()
var aaa = $("aaa");
var bbb = $("bbb");
aaa.onclick = function() {alert(this.value);}
bbb.onclick = aaa.onclick.bind(bbb);
</script>
<script type="text/javascript">
/*
* 将整数形式RGB颜色值转换为HEX形式
*/
/*Number.prototype.toColorPart = function() {
var digits = this.toString(16);
if (this < 16) return '0' + digits;
return digits;
}*/
var ColorNum=255;
alert("Number.prototype.toColorPart:\n HEX: "+ColorNum.toColorPart());
</script>
<body>
</body>
</html>
评论4
最新资源