I use Ubuntu 13.10 and I know few HTML editors for it.
The editor I use is the bluefish, which has helped me a lot. I'm learning javascript from w3shcool and I'm currently in the DOM nodes part, and as it's a bit more complicated to understand, I searched for an internet video that would help me understand about us, and found a video explaining the html "family tree" .
When I tested the following code:
window.onload = function()
{
var div = document.getElementsByTagName("div").item(0);
var ul = div.childNodes.item(0);
Alert(ul);
}
I figured it should return as object HTMLULLISTELEMENT
; But it is returned as: object text.
Using firebug I discovered that the problem is the space between the div and the ul ie the tab that the bluefish editor gives or is it is considering space as text.
How can I resolve this?
The well explained video about tree (nodes) is this:
The full code below:
<html>
<head>
<title>Core Api</title>
<script>
window.onload = function()
{
var div = document.getElementsByTagName("div").item(0);
var ul = div.childNodes.item(0);
alert(ul);
}
</script>
</head>
<body>
<h2>Árvore</h2>
<div>
<ul>
<li id="item1">
Primeiro
<span style="color:blue;">item</span>
<ul>
<li id="item 1.1">item1.1</li>
<li id="item 1.2">item1.2</li>
<li id="item 1.3">item1.3
<ul>
<li id="item 1.3.1">item1.3.1
</ul>
</li>
</ul>
</li>
<li>item2</li>
<li>item3</li></ul></div>
</body>
</html>