JavaScript事件串联之土办法
<input type=button id='btn1' onclick="alert('btn1')" value='1'>
<input type=button id='btn2' onclick="func_serial(this)" value='2'>
<script language=javascript>
function func_serial(obj)
{
var functor = btn1.onclick;
var func = functor.toString();
var p = func.indexOf("{");
var q = func.lastIndexOf("}");
var func2 = func.substring(p+1,q-1);
func2 += ";alert('2'); ";
btn1.onclick = new Function(func2);
}
</script>
<input type=button id='btn2' onclick="func_serial(this)" value='2'>
<script language=javascript>
function func_serial(obj)
{
var functor = btn1.onclick;
var func = functor.toString();
var p = func.indexOf("{");
var q = func.lastIndexOf("}");
var func2 = func.substring(p+1,q-1);
func2 += ";alert('2'); ";
btn1.onclick = new Function(func2);
}
</script>