- MooTools 1.2 Beginner's Guide
- Jacob Gube Garrick Cheung
- 216字
- 2021-04-01 13:33:38
Chapter 3. Selecting DOM Elements
In the last chapter, we learned about the MooTools syntax as well as JavaScript best practices. More specifically, we discussed unobtrusive JavaScript and how we should separate our structure (HTML) from our website's behaviors (JavaScript).
In order to successfully and effortlessly write unobtrusive JavaScript, we must have a way to point to the
Document Object Model
(DOM
) elements that we want to manipulate. The DOM is a representation of objects in our HTML and a way to access and manipulate them. In traditional JavaScript, this involves a lot (like, seriously a lot) of code authoring, and in many instances, a lot of head-banging-against-wall-and-pulling-out-hair as you discover a browser quirk that you must solve.
Let me save you some bumps, bruises, and hair by showing you how to select DOM elements the MooTools way. This chapter will cover how you can utilize MooTools to select/match simple elements (like, "All div elements") up to the most complex and specific elements (like, "All links that are children of a span that has a class of
awesomeLink
and points to
In this chapter we will look at:
- The
$()
and$$()
functions - Selecting HTML elements with pseudo-class selectors
- Selecting HTML elements based on their attributes
So let's get on with it!
- Vue.js前端開發(fā)技術(shù)
- vtiger CRM Beginner's Guide
- Scratch 1.4: Beginner’s Guide
- PPT設(shè)計實用教程
- MySQL Admin Cookbook LITE: Configuration, Server Monitoring, Managing Users
- Microsoft SharePoint 2010 Power User Cookbook: SharePoint Applied
- 板繪教室:SAI零基礎(chǔ)日系動漫插畫入門教程
- AI繪畫實戰(zhàn):Midjourney從新手到高手
- PowerPoint 2016實戰(zhàn)從入門到精通(超值版)
- After Effects印象 影視高級特效光影篇
- MATLAB在日常計算中的應(yīng)用
- OpenAM
- 中文版Photoshop CC 2018基礎(chǔ)培訓(xùn)教程(全彩版)
- AutoCAD 2010 機(jī)械設(shè)計與制作技能基礎(chǔ)教程
- CAXA CAD電子圖板和3D實體設(shè)計2021基礎(chǔ)入門一本通