When a dynamic webpage is used, JavaScript is sometimes used to dynamically control some events of a webpage element. For example, when a user does some operations, the onmouseover event of the element must be disabled, when you need to enable this event after other operations, you need to perform dynamic control as follows:
Function Disableallpricebutton (v ){
OBJ = Document. getelementbyid ( " Apb_1 " );
If ( ! V)
{
OBJ. onmouseover = Function (){ This . Classname = 'Pai _ bidactionhover ';};
OBJ. onmouseout = Function (){ This . Classname = 'Pai _ bidaction ';};
OBJ. detachevent ( " Onclick " , Addprice );
OBJ. attachevent ( " Onclick " , Addprice );
OBJ. classname = " Pai_bidaction " ;
} Else {
OBJ. onmouseover = Function (){};
OBJ. onmouseout = Function (){};
OBJ. detachevent ( " Onclick " , Addprice );
OBJ. classname = " Pai_bidactionoff " ;
}
}
FunctionAddprice (){
Alert (event. srcelement. ID );
}