OLD | NEW |
| (Empty) |
1 <style> | |
2 area { | |
3 display: inline; | |
4 } | |
5 </style> | |
6 <p>When an anchor tag catch 'href' attribute or release 'href' attribute, distri
bution should happen.</p> | |
7 <div id="host1"></div> | |
8 <div id="host2"></div> | |
9 <script> | |
10 function createArea(href, textContent) | |
11 { | |
12 var area = document.createElement('area'); | |
13 if (href) | |
14 area.setAttribute('href', href); | |
15 area.appendChild(document.createTextNode(textContent)); | |
16 | |
17 return area; | |
18 } | |
19 | |
20 var area1 = createArea('http://www.example.com/', 'Anchor 1'); | |
21 var area4 = createArea('http://www.example.com/', 'Anchor 4'); | |
22 | |
23 host1.appendChild(area1); | |
24 host2.appendChild(area4); | |
25 </script> | |
OLD | NEW |