Documente Academic
Documente Profesional
Documente Cultură
A less-than sign < A word or character Optional space followed by: Any number of optional HTML attributes in the form of a name="value" pair And finally a greater-than sign >
What is HTML?
A guide to learning html for beginners. HTML are initials that stand for Hyper Text Markup Language Hyper is the opposite of linear. It used to be that computer programs had to move in a linear fashion. This before this, this before this, and so on. HTML does not hold to that pattern and allows the person viewing the World Wide Web page to go anywhere, any time they want. Text is what you will use. English letters, just like you use everyday.. Markup is what you will do. You will write in plain English and then mark up what you wrote. Language. Some may argue that technically html is a code, but you write html in plain, everyday English language.
What is method..?
Methods define functions performed by an object. Making a reference to an object method is similar to referencing its property. Thus, document.write(); calls the write() method of the document object. Herein lies an important difference in how methods and properties are refered. Methods are always followed by a pair of parenthesis. Some methods take a value part inside the parenthesis. You would know this by now since you have encountered the write() method in the previous sessions. To refresh your memory here is the code again:
document.write("I Love JavaScript");
The text I Love JavaScript is passed as a value to the write() method of the document object. The main function of this method is to take the value and display it in the browser window. Different objects have different methods associated with them. The submit() method of a form object causes the form to be submitted. The log() method of the Math object computes the logarithm of the number supplied.
Math.log(2); computes the logarithm of 2. The number is passed to the method inside the parenthesis and is called the argument. Similarly, in the example before, I Love JavaScript was the argument passed to the write() method.
1.
What do you think following methods do? a. Math.tan(3); b. Math.sqrt(4); c. d. e. document.write("www.webdevelopersnotes.com"); window.close(); window.scroll();
Whats the difference? The short answer is, use both and dont worry about it. But if you want to understand this goofiness, heres the skinny: name= is for use as a target like this: <a name="XXX"></a> for links like this: <a href="#XXX". name= is also used to label the fields in the message send to a server with an HTTP (HyperText Transfer Protocol) GET or POST when you hit submit in a form. id= labels the fields for use by JavaScript and Java DOM (Document Object Model). The names in name= must be unique within a form. The names in id= must be unique within the entire document. Sometimes the the name= and id= names will differ, because the server is expecting the same name from various forms in the same document or various radio buttons in the same form as in the example above. The id= must be unique; the name= must not be. JavaScript needed unique names, but there were too many documents already out here without unique name= names, so the W3 people invented the id tag that was required to be unique. Unfortunately older browsers did not understand it. So you need both naming schemes in your forms.
What is attribute?
Attributes provide additional information about HTML elements.
HTML Attributes
HTML elements can have attributes Attributes provide additional information about an element Attributes are always specified in the start tag Attributes come in name/value pairs like: name="value"
Example
<a href="http://www.w3schools.com">This is a link</a>
Attributes
Attribute align Value left right center justify Description Not supported in HTML5. Deprecated in HTML 4.01.Specifies the alignment of the content inside a <div> element
Description Specifies a shortcut key to activate/focus an element Specifies one or more classnames for an element (refers to a class in a style sheet) Specifies whether the content of an element is editable or not Specifies a context menu for an element. The context menu appears when a user right-clicks on the element Specifies the text direction for the content in an element Specifies whether an element is draggable or not Specifies whether the dragged data is copied, moved, or linked, when dropped Specifies that an element is not yet, or is no longer, relevant Specifies a unique id for an element Specifies the language of the element's content Specifies whether the element is to have its spelling and grammar checked or not Specifies an inline CSS style for an element Specifies the tabbing order of an element Specifies extra information about an element
contenteditableNew contextmenuNew