Writing to a PAGE
Multi-page sites
Different styles Splash page – no content to start; never return Hub and spokes – a base page that directs you to the others Sequential – to be read in order Peers – no order or dependencies Subpages – main page that leads you to others
Splash Page SPLASH
HUB AND SPOKES HUB
SEQUENTIAL
PEERS
SUBPAGES PAGE
More selectors
selective formatting Need to identify the elements that you want to format We have seen All elements Elements based on classes Elements based on context Pseudo-elements
Two new options Use an id Use any attribute Element#idname Removes the need for class and id on the same element Use any attribute Element[attribute=“value”] Allows you to format only a single input field (name) or type (text)
Selecting based on attributes tag[attribute=“value”] Formatting only applies to tags with that attribute value Tag.classname is same as Tag[class=“classname”] Other options (rarely used) w3schools
Chrome console
Writing to PAGE
Multiple options: just one today INPUT type=TEXT or NUMBER User can set So can you! Need your next JavaScript statement!
Writing to the Page Can write to an input field as well as read it <form name="typing"> <input type="text" name="input“> <input type="text" name="output" > </form> typing.output.value=typing.input.value;
Assignment Statement: “takes the value of” The most fundamental statement in programming Destination = source; Destination takes the value of the source Evaluate the source Assign that value to destination Source can be literal, field or expression In this case, the destination is the text field called output
Now 2 options for onclick Alert Assignment