learning2play
23 Jul 2010, 05:05 PM
Hi, just followed a tutorial which showed how to use javascript to switch between divs.
Script seems to work fine, but theres a part i dont understand.
function ShowContent(d,e) {
if (d.length < 1) {return;} - Not sure what this line here does?
document.getElementById(d).style.display = "block";
document.getElementById(e).style.display = "none";
}
<a
onclick="ShowContent('one','two'); return true;"
href="javascript:ShowContent('one')">
Page 1
</a>
Anyone care to enlighten me? ;)
Script seems to work fine, but theres a part i dont understand.
function ShowContent(d,e) {
if (d.length < 1) {return;} - Not sure what this line here does?
document.getElementById(d).style.display = "block";
document.getElementById(e).style.display = "none";
}
<a
onclick="ShowContent('one','two'); return true;"
href="javascript:ShowContent('one')">
Page 1
</a>
Anyone care to enlighten me? ;)