【js】趙雅智_js複選框全選反選全不選案例
阿新 • • 發佈:2019-02-16
html介面:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>nameNode.html</title> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="this is my page"> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <!--<link rel="stylesheet" type="text/css" href="./styles.css">--> </head> <script type="text/javascript" src="./js/nameNode4.js" charset="UTF-8"></script> <body> <div> 興趣愛好: <br> <br> <input type="checkbox" name="fav" value="look" checked="checked"> 看書 <input type="checkbox" name="fav" value="write"> 寫字 <input type="checkbox" name="fav" value="drow"> 畫畫 <input type="checkbox" name="fav" value="dubao"> 讀報 <input type="checkbox" name="fav" value="TV"> 看電視 </div> <div> <input type="radio" name="hx" id="qx" value="1" onclick="test(1)"> 全選 <input type="radio" name="hx" id="fx" value="2" onclick="test(2)"> 反選 <input type="radio" name="hx" id="qbx" value="0" onclick="test(0)"> 全不選 </div> </body> </html>