Copy codeThe Code is as follows:
<! DOCTYPE html>
<Html>
<Head>
<Title> my name is lian lily </title>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8">
<Script src = "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"> </script>
<Script type = "text/javascript">
Var times = 0
Function show (obj ){
$ ("# Btn _" + obj). attr ("disabled", "disabled"); // set the button to unavailable
Times ++;
If (times = 2 ){
Alert (obj );
Times = 0;
$ ("# Btn _" + obj). removeAttr ("disabled ");
Return;
}
// $ ("# Frm" + obj). submit ();
SetTimeout ("show (" + obj + ")", 3000 );
}
</Script>
</Head>
<Body>
<Form action = 'Post. php' method = "post" name = "frm1" id = "frm1">
<Input type = "button" name = "btn_1" id = "btn_1" value = "Submit 1" onclick = "show (1)"/>
</Form>
<Form action = 'Post. php' method = "post" name = "frm2" id = "frm2">
<Input type = "button" name = "btn_2" id = "btn_2" value = "Submit 2" onclick = "show (2)"/>
</Form>
</Body>
</Html>