Click the same button to hide and switch between the div and the actual switch.
Click the same button to hide the div and switch to reality:
In many applications, this function is available. clicking the same button can hide and hide the div. Of course, the operation does not have to be a button or div, but the principle is the same, the following describes how to implement this function through code examples.
The Code is as follows:
<! DOCTYPE html>
The above code can achieve the desired effect. Here we mainly use the toggle () function.
Note: The toggle () function has been deleted in jQuery1.9.
Related reading:
1. For more information about the toggle () function, see the toggle () method section of jQuery.
2. For more information about the hide () function, see the hide () method section of jQuery.
3. For more information about the val () function, see the val () method section of jQuery.
4. For more information about the show () function, see the show () method section of jQuery.
The original address is: http://www.softwhy.com/forum.php? Mod = viewthread & tid = 12222.
For more information, see: http://www.softwhy.com/jquery/