Question 5. Consider the following code fragment: Chtml> cheado This is a paragr
ID: 3751638 • Letter: Q
Question
Question 5. Consider the following code fragment: Chtml> cheado This is a paragraph./p> p>This is another paragraph./p> K/html> Write a piece of code in JavaScript to remove all the styles from the web-page. Question 6. Write down a JavaScript expression to remove all the rows of a table>. Assume that there is ONLY one table in the page and that the table has at least one row with at least one column (the exact number of columns is unknown to us) Question 7. Develop a JavaScript function that takes a DOM element as argument and reverses the order of its children, i.e. first child becomes last child, second child becomes one before last child, etc. (This question in duplicated from Test Two)Explanation / Answer
answer 5
or you can also use the jquery for removing the styles:
answer 6
This piece of code will delete all the rows from the HTML table where tableId represents the id of the table (<table id="tableID">)
var Parent = document.getElementById(tableID);
while(Parent.hasChildNodes())
{
Parent.removeChild(Parent.firstChild);
}
answer 7
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.