• JQuery[02] 基本属性方法的调用


     1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    2 <html xmlns="http://www.w3.org/1999/xhtml">
    3 <head>
    4 <title></title>
    5 <script src="../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    6 <script type="text/javascript">
    7 $(function () {
    8 //设置文本居中
    9 $("#text").css("text-align", "center");
    10 $("#getInnerText").click(function () {
    11 alert($("#text").text());
    12 });
    13 $("#getInnerHtml").click(function () {
    14 alert($("#text").html());
    15 });
    16 $("#change").hide().show("5000").click(function () {
    17 $("#text").html("当前时间是:" + new Date());
    18 });
    19 })
    20 </script>
    21 </head>
    22 <body>
    23 <p id="text">这是<font color="red">测试</font>文本</p>
    24 <input id="getInnerText" type="button" value="获得InnerText" />
    25 <input id="getInnerHtml" type="button" value="获得InnerHtml" />
    26 <input id="change" type="button" value="改变文本值" />
    27 </body>
    28 </html>

      

    My New Blog : http://blog.fdlife.info/ The more you know, the less you believe.
  • 相关阅读:
    手把手教你学Git
    服务器上Mysql的安装与配置
    python 5
    python 4
    python 3
    python 2
    区分命令行模式和Python交互模式
    CUDA编程模型之内存管理
    多目标优化算法-NSGA2
    C# ListView 如何添加列标头
  • 原文地址:https://www.cnblogs.com/ForDream/p/2130503.html
Copyright © 2020-2023  润新知