Example: Extracting information
Notice the following:
- The use of the property
style
to extract styling information. - The use of the method
.getAttribute(attribute)
. - The differences between the properties
innerHTML
andtextContent
.
Note:
Hints:
- undefined
1
2
var redLargeNode = document.getElementById("redlarge");
var normalNode = document.getElementById("normal");
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
<!DOCTYPE html>
<html lang="en">
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX