Thanks, Stephen. Nice to see you again.
I did download Firebug, but I’m not even sure whether “console.log” is part of Firebug. Also the Firebug Web site clearly implies a long learning curve, and I’m axious to get a new book review on our Web site. “Alert” also shows the values of any variable at any point, and that would seem to be all we need for the problem I’m having.
However, another way to do the coding suddenly occurred to me. The new logic works. On the other hand, I surely would appreciate learning why the code in my post #1 doesn’t work. I have no doubt that not finding out now what the problem is will come back to haunt me in the future.
In reviewing this thread, could any of these be the problem or part of it:
(1) As I said in my post #4, my Javascript code is in <head> rather than following the actual HTML list of book titles.
(2) document.getElementsByTagName returns a “NodeList,” not a true Array variable. Is my code trying to do something only valid on true Arrays?
(3) This Web page has been working fine as more and more books reviews were added for probably two years now. What caused me to put in this new code that isn’t working is that for the first time one of the book reviews on the page (which is below the <li> list of books) has a bulleted list. But only the bulleted list of book titles has an id starting with “liBook”; in fact, the <li>s in the review itself don’t have ids at all. So I tried using two arrays, where the second one contained only those <li>s that belonged to the book title list. The <li>s for the book title list all look like this:
<li id="liBookReview1" class="white"
style="cursor: pointer;">
<i>The Holy Spirit in the Old Testament</i> by Leon J. Wood (1976)</li>
One of the later <li>s inside a review looks like this:
<li style="margin-bottom: 15px;">This occasion could not have preceded the Carchemish victory, because the Babylonian king, who at the time laid siege to Jerusalem (Dan. 1:1), had no access as far west as Jerusalem until after this victory had been achieved.</li>
Could the dissimilarities between the <li>s in the book list and the <li>s within the text of the book review cause a problem with my code posted in my post #1?
Again, thanks for any help you can give me.
Ken