====== Webcode - Across header ====== ===== Description ===== A webcode may be used across several header in order to create a How to for instance. In this case: * the TOC should not break * the edit should go to the good location ===== Example: How to Steps ===== ==== Define a css stylesheet ==== We define a stylesheet to show that the value of ''element.style.fontSize'' is not defined in this case. .sheet { font-size: 15px } ==== Create the HTML page ==== * with an inline style

A p element with the font-size defined inline

* with a class defined in the sylesheet

A p element with the font-size defined by a stylesheet

==== Retrieve the elements with Javascript ==== * Get all P element allP = document.querySelectorAll("p"); ==== Output the value of element.style.fontSize for each element ==== * The first ''p'' element will have a element.style.fontSize console.log("The first p with an inline definition has a fontSize property of "+allP.item(1).style.fontSize); * The second will have not console.log("The second p with a stylesheet definition has an undefined fontSize property "+(typeof allP.item(0).style.fontSize == 'undefined')); ==== Result ====