Home > front end >  How to implement the following code duplication click operation, small white to get started. Thank y
How to implement the following code duplication click operation, small white to get started. Thank y

Time:10-13

<script type="text/javascript"> The function $(id) {return document. The getElementById (id); } window. onl oad=function () {var x1=$(" box_span1 "); Var x2=$(" box_span2 "); Var x3=$(" box_p "); X1. Onclick=function () {x3. Style. Background="# 000000"; X1. Style. BorderRadius="50%"; X1. Onclick=function () {x3. Style. Background=null; X1. Style. BorderRadius=null; }}//a loop click; } & lt;/script>

<body>


CodePudding user response:

 
Window. The onl oad=function () {
Var x1=$(" box_span1 ");
Var x2=$(" box_span2 ");
Var x3=$(" box_p ");
X1. Onclick=function () {
If (x3) style) background=="") {
X3. Style. Background="# 000000";
X1. Style. BorderRadius="50%";
} else {
The x3. Style. Background="";
X1. Style. BorderRadius="";
}
}
}

CodePudding user response:

Thank the bosses guidance, can direct messages contact information
  • Related