Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
- <title>Our Insurance</title>
- </head>
- <body>
- <!-- Навигация в DOM; Взаимодействие с върхове -->
- <!-- File:listing-8-1.htm -->
- <div id="heading1">Buildings Insurance</div>
- <p id="para1">
- You need this type of insurance to cover you in case of
- <span id="risk">severe damage to your home</span>
- (for example fire, flood, vehicle or tree crashing into it)
- as well as more everyday risks like accidentally breaking a window
- </p>
- <div id="heading2">Contents Insurance</div>
- <p id="para2">
- You need this type of insurance to cover
- <span id="items">things in your house</span>,
- such as furniture, electrical goods, carpets and curtains, against risks such as fire, theft, water damage (due to burst pipes, etc) or accidental breakage
- </p>
- <script type="text/javascript">
- <!--
- document.write("Paragraph 1 is node name " + document.getElementById("para1").nodeName);
- document.write("<br />Paragraph 1 is node type " + document.getElementById("para1").nodeType);
- document.write("<br />The text node firstChild inside paragraph 1 is " + document.getElementById("para1").firstChild.nodeValue);
- document.write("<br />The text node lastChild inside paragraph 1 is " + document.getElementById("para1").lastChild.nodeValue);
- document.write("<br />The attribute value of the first div is " + document.getElementById("heading1").getAttribute("id"));
- // -->
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement