fellowtraveler
Coder
Code:
let node = document.createElement('p');
let linebreak = document.createElement('br');
let textnode = document.createTextNode("noun count = " + noun_count + "; verb count = " + verb_count);
node.appendChild(textnode);
document.getElementById("par1").appendChild(node);
textnode = document.createTextNode("; others count = " + adjetc_count + "; total count = " + vocab_count);
node.appendChild(textnode);
document.getElementById("par1").appendChild(node);
swahili_word = swahili_word.toLowerCase();
node.appendChild(linebreak);
document.getElementById("par1").appendChild(node);
textnode = document.createTextNode("Swahili word - " + swahili_word);
node.appendChild(textnode);
document.getElementById("par1").appendChild(node);
and it worked fine. I then added the following:
let dict_pos = trsnoun(swahili_word);
if (dict_pos > -1)
{
eng_word = nouns[dict_pos].engsing;
node.appendChild(linebreak);
document.getElementById("par1").appendChild(node);
textnode = document.createTextNode("English word(s) - " + eng_word);
node.appendChild(textnode);
document.getElementById("par1").appendChild(node);
return;
}
Now the second linebreak works but the first stopped working:
noun count = 3118; verb count = 2104; others count = 524; total count = 5746Swahili word - kilima
English word(s) - hill
Can anyone tell me why?
Last edited by a moderator: