Question
Write a function to find all the HTML comments in the body section of a page and concatenate them into a single string. Add some
Write a function to find all the HTML comments in the body section of a page and concatenate them into a single string. Add some comments to the code listed in Listing 11.2; then introduce and test your new function.
Below is 11.2 and this is Javascript
document.write(document.lastModified);
function countListItems()
{
var text = '';
var olElement = document.getElementById("toDoList");
var listItems = olElement.getElementsByTagName("li");
alert(" The ordered list contains " + listItems.length + " items");
}
window.onload = countListItems;
Things To Do
- Mow the lawn
- Clean the windows
- Answer your email
Make sure all these are completed by 8pm so you can watch the game on TV!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started