Skip to Content
深入淺出 jQuery
book

深入淺出 jQuery

by Ryan Benedetti, Ronan Cranley
February 2012
Intermediate to advanced
540 pages
11h 39m
Chinese
GoTop Information, Inc.
Content preview from 深入淺出 jQuery
138 第四章
在下列空白處,撰寫選擇器以及 remove detatch 的相關程
式碼,產生左邊所顯示的結果。
li
ul class=
"menu_list"
ul class=
"menu_entrees"
li class=
"fish"
li
li
li
div id="top"
div class=
"pic_box"
jQuery
陳述式
DOM
結果
div id="news_story"
p
p
img
$(“div#top").remove()
當你對元素執行
remove 或 detach
時,該元素的所
有子元素也會被
移除或解除。
$(“div p").detach()
$(“li.fish").detach()
記住,選擇器
比對出來的所
有元素都會被
解除。
當你將元素以 class
分群或者設定 ID 時,
就可以更明確地選
取那些元素。
li
p, p
調整
DOM
目前位置 4 139
jQuery 網頁操作
測試版
my_scripts.js 裡, vegOn click 3 個「削
你的鉛筆」解答裡的程式碼,然後在你最喜愛的瀏覽器上開啟該頁面,確
認一切運作無誤。
在執行$("li.fish").detach()
之前。
在執行 $("li.fish").detach() ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

HTML5 錦囊妙計

HTML5 錦囊妙計

Christopher Schmitt, Kyle Simpson
Pro JSF and HTML5: Building Rich Internet Components, Second Edition

Pro JSF and HTML5: Building Rich Internet Components, Second Edition

Hazem Saleh, Allan Lykke Christensen, Zubin Wadia

Publisher Resources

ISBN: 9789862764060