Tip: you can modify some code before running
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head> <title>JavaScript control div code</title> <style type="text/css">. Mask {width: 300px; height: 300px; background-color: # ccc; border: 1px solid # ccc ;}</style> <script type="text/javascript">Var pop = {maskStyle: 'mask', theMask: null, init: function () {var popToggle = document. getElementById ('pop'); popToggle. onfocus = pop. popDiv; popToggle. onblur = pop. popDiv;}, popDiv: function (e) {e = window. event | e; switch (e. type) {case 'core': theMask = document. createElement ('div '); theMask. className = pop. maskStyle; document. body. appendChild (theMask); break; case 'blur': if (theMask) {theMask. parentNode. removeChild (theMask);} break;} window. onload = pop. init;</script></head><body> <input type="text" name="pop" id="pop"></body></html>
Tip: you can modify some code before running