jQuery 設定プロパティに関する情報

jQueryは属性情報の値を設定します

$().attr(属性名, 値) //属性情報を設定します

<!DOCTYPE html>
<html>
    <head>
        <title>php.cn</title>
        <meta charset="utf-8" />
        <script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script>
        <script>
            function get(){
                $("#in").attr('value','大家好');
            }
        </script>
    </head>
    <body>
        <input type="text" value="你好" id="in"/>
        <input type="button" value="设置属性" onclick="get()">
    </body>
</html>
学び続ける
||
<!DOCTYPE html> <html> <head> <title>php.cn</title> <meta charset="utf-8" /> <script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script> <script> function get(){ $("#in").attr('value','大家好'); } </script> </head> <body> <input type="text" value="你好" id="in"/> <input type="button" value="设置属性" onclick="get()"> </body> </html>
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!