before your script. These add an extra layer of methods for you to manipulate the DOM easily, and they have in-depth documentation that explains how to use each method for what you want to do.
I'll work through how the stuff you posted originally works, and hopefully answer your queries along the way. The initial onclick attribute has 3 calls within it:
This redirects the browser to an empty anchor and afaik appears to be useless.
|setBossMissions('<div align=\'center\'><table width=\'98%\'><tr><td class=\'quote_menu_cap\' colspan=\'4\' style=\'text-align:left;\'>Missioni per conto di Seth Briars</td></tr><tr><td width=\'25%\' class=\'quote_menu\'><a href=\'../red-dead-redemption/soluzione-esumazione-e-altri-simpatici-hobby.html\'>L\'esumazione e altri sim...</a></td><td width=\'25%\' class=\'quote_menu\'><a href=\'../red-dead-redemption/soluzione-un-bel-giro-con-gli-amici.html\'>Un bel giro con gli amici</a></td><td width=\'25%\' class=\'quote_menu\'><a href=\'../red-dead-redemption/soluzione-lasciate-che-i-morti-seppelliscano-i-morti.html\'>Lasciate che i morti...</a></td><td width=\'25%\'> </td></tr></table/></div>');|
This calls the setBossMissions() function and sends it a long string of markup as an argument. The apostrophes within the markup are prefixed with backslashes (called "escaping" the characters) because the entire string's delimiter
As it happens, since both speech marks (") and apostrophes are valid for HTML attributes and
The final of the 3 calls is:
The setBossMissions() function:
|div = document.getElementById('BossMissions');|
This locates the first HTML element it can find with an "id" attribute matching "BossMissions", and assigns an object that can be used to manipulate that element to the variable "div".
|div.innerHTML = str;|
This uses the "div" object created above to add content within the id="BossMissions" div. The content is the variable "str", which is the first argument of the BossMissions() function. The argument passed is the long string of markup with all the escaped apostrophes.