0
0m4r
Good Morning everybody
I'm gonna to be crazy about, maybe, a stupid Javascript problem.
What I would like to code is a javascript script to obtain something
like this:
<div>
<span>title: the title</span>
<br/>
<span>link: the link</span>
</div>
the script I'm using is reported below, but it seems to not work
because it don't give me the the two span elements on the same line
(and isn't what I want...)
var br = document.createElement("br");
var span = document.createElement("span");
var div = document.createElement("div");
span.appendChild(document.createTextNode("title: " + title))
div.appendChild(br);
div.appendChild(span);
span.appendChild(document.createTextNode("link: " +
link));
div.appendChild(br);
div.appendChild(span);
Where I'm wrong? Could anybody to help me?
thx a lot,
Omar
I'm gonna to be crazy about, maybe, a stupid Javascript problem.
What I would like to code is a javascript script to obtain something
like this:
<div>
<span>title: the title</span>
<br/>
<span>link: the link</span>
</div>
the script I'm using is reported below, but it seems to not work
because it don't give me the the two span elements on the same line
(and isn't what I want...)
var br = document.createElement("br");
var span = document.createElement("span");
var div = document.createElement("div");
span.appendChild(document.createTextNode("title: " + title))
div.appendChild(br);
div.appendChild(span);
span.appendChild(document.createTextNode("link: " +
link));
div.appendChild(br);
div.appendChild(span);
Where I'm wrong? Could anybody to help me?
thx a lot,
Omar