久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      如何判斷html中文本框內(nèi)容是否為空

      如何判斷html中文本框內(nèi)容是否為空

      1.通過PHP語句判斷 :

      html中內(nèi)容:

      <form action="submit.php" method="post"> <textarea name="text"></textarea> </form>

      php中內(nèi)容:

      //submit.php <?php if(isset($_POST['text']) && strlen(trim($_POST['text']))>0) echo '不空'; else echo '空 '; ?>

      2.通過JS語句判斷

      <html> <head> <title>JS判斷input是否為空</title> <script>function op(){ 	if(document.getElementById("ip").value==""){ 		alert("input為空"); 	}else{ 		alert(document.getElementById("ip").value); 	} 	} </script> </head> <body>     <input id="ip" onblur="op()" value="JS"/> </body> </html>

      3.通過required屬性判斷

      <html lang="en"> <head>     <meta charset="UTF-8">     <meta http-equiv="X-UA-Compatible" content="IE=edge">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <title>表單</title> </head> <body>     <form action="" style="display: grid;" method="POST">           <div>          <label for="username">賬號:</label>         <input type="text" id="username" required>                                   <!--required為必須填寫數(shù)據(jù)-->     </div> </body> </html>

      推薦:《html知識》

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號