国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Peristiwa perubahan kandungan kotak teks JavaScript (onchange)

Acara perubahan kandungan kotak teks (onchange)


Acara onchange dicetuskan dengan menukar kandungan kotak teks dan program yang dipanggil ialah dilaksanakan pada masa yang sama.

Kod berikut, apabila pengguna menukar teks dalam kotak teks, kotak dialog "Anda baru sahaja mengubah suai profil peribadi anda" akan muncul.

<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>php.cn</title>
        <script>
            function fun(){
                window.alert("您剛剛修改了個人簡介")
            } 
        </script>
    </head>
    <body>
        <form>
            個性介紹:<br/><textarea name=" introduction" cols="30" rows="4" onchange="fun()">小明:
            PHP高級工程師
            全棧工程師</textarea>
        </form>
    </body>
</html>


Meneruskan pembelajaran
||
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>php.cn</title> <script> function fun(){ window.alert("您剛剛修改了個人簡介") } </script> </head> <body> <form> 個性介紹:<br/><textarea name=" introduction" cols="30" rows="4" onchange="fun()">小明: PHP高級工程師 全棧工程師</textarea> </form> </body> </html>