reading notes for code fellows
forms allow users to perform many functions online, such as registeration, and shopping.
there are several form controls useable to collect information from users.
<input type="text" name="inputIdentifierHere"> optional <maxlength=""><input type="password" name="inputIdentifierHere"> optional <maxlength=""><textarea><input type="radio" name="inputIdentifierHere" value="valueForThisButton"> optional checked="checked" to autoselect this value on load<input type="checkbox" name="inputIdentifierHere" value="valueForThisBox"> optional checked="checked" to autoselect this value on load<select name="inputIdentifierHere"> <option value="valueForThisBox"> optional selected="selected" to autoselect this value on load multiple="multiple" to allow the user to select multiple options<input name="inputIdentifierHere" value="valueForThisBox"><input type="image"><input type="file" name="inputIdentifierHere"><button> allows you to control how your button looks<input type="hidden" name="insertIdentifierHere"> puts form controls on the page that are invisible to the user<label>is used to help with screen readers and can either wrap around the entire input with the text description at the start or be on a separate line and use the for attribute to identify which input it is labeling.<fieldset> will group the elements in a form together and <legend> can follow it to identify what the purpose of the group is<input type="date" name="insertIdentifierHere"><input type="email" name="insertIdentifierHere"> will check the format is valid<input type="url" name="insertIdentifierHere"> will check the format is valid<input type="search" name="inputIdentifierHere"> optional placeholder="placeholderTextHere"how forms work: a user submits information to the server, the name of each form control and its data is processed by the server, the server creates a new page to send back based on the registered info. To differentiate between data, all the info is sent using name/value pairs, ex username=dana. If the value is text, it will be whatever the user types, if the value is an option, it will be assigned based on whatever the user chose.
a form is created with the <form> element and an action attribute containing the URL for the page on the server recieving information from the form. It will be sent using either the get (values are added to the end of the URL, ideal for short forms) or post (sent as HTTP headers, good for if the user needs to submit a file or the form is long/contains sensitive data) method attribute. If not method, the id attribute is used to differentiate the data in the form from the rest of the page.
list-style-type allows you to conrol the shape and style of a bullet point.
list-style-image url("#") allows you to specify an image to act as a bullet point.
list-style-position allows you to either put the marker outside or inside your block of text.
table properties:
width - sets the width of the tablepadding - sets the space between the border of the cell and its contenttext-transform - converts the contents of headers to uppercaseletter-spacing / font-size - adds addition styling to table headersborder-top / border-bottom - sets borders above and below table headerstext-align - aligns the writing to the left of some cells and the right of othersbackground-color - changes the background color of alternating rows:hover - highlights a row when the users mouse goes over it.if you have empty cells, you can use empty-cells to specify whether or not their borders should be shown
you can specify whether there should be gaps between cells using border-spacing and border-collapse
an easy way to ensure your inputs line up is to use <label> to give them names, then float the names to the left and give them a fixed width so their input boxes will start in the same place.
cursor allows you to control how the cursor is displayed to users/
event types:
when an event has occured it has fired or been raised, these events will trigger scripts or functions
<input> or <textarea> has changedselect-box checkbox or radio-button changeswhen a user interacts with HTML it has three steps (known as event handling) to trigger JavaScript code
three ways to bind an event to an element
DOMelement.addEventListener('event', functionName [,boolean]), to call use variableName.addEventListener('blur', checkUsername, false)event flow
event object tells you about the event and the element it happened upon
the event object has changing methods the default behavior of an element and how its ancestors respond to the event