Writing to a PAGE
Multiple options: just one today INPUT type=TEXT or NUMBER User can set So can you! Assignment statement: output-cubby “takes the value of” input-cubby
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
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
new option Use any attribute Allows you to format only a single 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