Skip to article
Global blog category: Digital Life
節點裡加入class = "selected" // 移除 : removeClass( class ). $("p").addClass("selected") @attr( name ) // 取得 裡的src值 // before : // Result : test.jpg $("img").attr("src"); @attr( properties ) // 將 加入 src="test.jpg" alt="Test Image" // before : // Result : $("img").attr({ src: "test.jpg", alt: "Test Image" }); @attr( key, value ) // 指定物件 的 key 並 設定 value // 將 加入 src = "test.jpg" // before : // Result : $("img").attr("src","test.jpg"); // 將 加入 value = "test.jpg" // before : // Result : $("input").attr("value","test.jpg"); @attr( key, fn ) // 在裡加入 title //title 值 則是用function 回傳 //Before: //Result: $("img").attr("title", function() { return this.src }); //Before : //Result: $("img").attr("title", function(index) { return this.title + (++index); }); @html() // 取得
裡的 class // Before :
Hello
裡的字串 // Before :
Test Paragraph.
Paraparagraph
內的字串 // Before :
Some new text.
有 class="selected" 移除 , 如果
沒有 class="selected" 則加入 // Before :
Hello Again
Posted by shian0745 at 痞客邦 PIXNET Comments(0) Trackback(0) Hits(1570)
Comment Permissions: Allow commenting
Comment Permissions: Allow commenting