Common js function code and js Code
Common js Function Code (continuous update ):
1 --- fold and expand
<Input id = "btnDisplay" type = "button" class = "baocun2" value = "add" onclick = "changeDisplay () "/> <script type =" text/javascript "> function changeDisplay () {var helloDivObj = $ (" # addressdiv "); var buttonObj = $ (" # btnDisplay "); var val = buttonObj. attr ("value"); if (val = "hide") {helloDivObj. hide (); buttonObj. attr ("value", "add");} else {helloDivObj. show (); buttonObj. attr ("value", "hide") ;}</script>
2 --- Select multiple boxes and click to make the text box editable
<Input disabled = "disabled" name = "telephone" id = "tel" class = "text" value = "123" type = "text"> <input id = "tellphones" value = "123" type = "hidden"> <input checked = "true" type = "checkbox" onclick = "mobile (this) "> <label for =" mobile_id_flag "style =" cursor: pointer "> same as the mobile phone number in the order </label> <script type =" text/javascript "> function mobile (_ this) {if (_ this. checked) {$ ("input [id = 'tel ']"). val ($ ("# tellphones "). val (); $ ("input [id = 'tel']"). attr ("disabled", "disabled");} else {$ ("input [id = 'tel']"). val (""); $ ("input [id = 'tel']"). removeAttr ("disabled") ;}</script>