posts - 165, comments - 198, trackbacks - 0, articles - 1
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          jquery學習筆記_2

          Posted on 2007-11-09 10:34 G_G 閱讀(329) 評論(0)  編輯  收藏 所屬分類: javascript Framework
          學習:http://visualjquery.com/1.1.2.html
          DOM
          Attributes

          1.attr(key, value)
          $("img").attr("title", "xx");
          也是對屬性的添加但可以動態
          eg:??? 在每次給title時 動態了開始
          <img title="pic" /><img title="pic" /><img title="pic" />
          通過$("img").attr("title", function(index) { return this.title + (i + 1); });
          <img title="pic1" /><img title="pic2" /><img title="pic3" />

          2.? html 內容取、賦值
          取??<div><input/></div>? ->>??$("div").html(); ->>? 結果:<input/>
          賦? $("div").html("<b>new stuff</b>"); ->><div><b>new stuff</b></div>
          通過這 ajax 就很簡單了。^_^

          Manipulation
          1.位置調換 after, append、before
          $("p").after("<b>Hello</b>");??? <p>后 添加 <b>..
          $("p").after( $("#foo")[0] );? 把id為foo的標簽移動到<p>后

          $("input[@name='butt1']").clone().prependTo("form"); //clone in form

          主站蜘蛛池模板: 六枝特区| 集安市| 廉江市| 西乌珠穆沁旗| 津市市| 辉南县| 临沂市| 武乡县| 威远县| 阳高县| 会东县| 克什克腾旗| 碌曲县| 嘉禾县| 冷水江市| 千阳县| 宁蒗| 安泽县| 韶山市| 江达县| 武定县| 濮阳市| 镇坪县| 衡阳市| 三门峡市| 延庆县| 晴隆县| 同德县| 台山市| 奉新县| 南安市| 丽水市| 枣强县| 嘉义县| 易门县| 阿尔山市| 石屏县| 吉木萨尔县| 香格里拉县| 莱阳市| 威海市|