YouTip LogoYouTip

Web Javascript

# JavaScript Guide * * * ## JavaScript - Client-Side Scripting JavaScript is a scripting language for the Web! JavaScript is used by millions of web pages to enhance design, validate forms, detect browsers, create cookies, and for many more applications. JavaScript is easy to learn ## JavaScript Examples # My First JavaScript Program This is a paragraph Display Date [Try it Β»](#) Click the "Try it" button to see the online example. * * * ## What is JavaScript? * JavaScript is designed to add interactive behavior to HTML pages. * JavaScript is a scripting language (a scripting language is a lightweight programming language). * JavaScript consists of lines of executable computer code. * JavaScript is usually embedded directly into HTML pages. * JavaScript is an interpreted language (meaning that code is executed without pre-compilation). * Anyone can use JavaScript without purchasing a license. * * * ## Client-Side Scripting JavaScript "dictates" browser behavior. This is known as client-side scripting (or browser scripting). Server-side scripting "dictates" server behavior (see the ASP/PHP tutorials on this site). * * * ## What Can JavaScript Do? * **JavaScript provides a programming tool for HTML designers** HTML creators are often not programmers, but JavaScript is a scripting language with extremely simple syntax! Almost anyone can put short code snippets into their HTML pages. * **JavaScript can put dynamic text into an HTML page** A JavaScript statement like this can put variable text into an HTML page: document.write("

" + name + "

") * **JavaScript can react to events** JavaScript can be set to execute when an event occurs, such as when a page has finished loading or when a user clicks an HTML element. * **JavaScript can read and write HTML elements** JavaScript can read and change the content of HTML elements. * **JavaScript can be used to validate data** JavaScript can be used to validate data before it is submitted to the server. * **JavaScript can be used to detect the visitor's browser** JavaScript can be used to detect the visitor's browser, and based on the detected browser, load the appropriate page for that browser. * **JavaScript can be used to create cookies** JavaScript can be used to store and retrieve information from the visitor's computer. * * * ## What is the HTML DOM? The HTML DOM defines standard methods for accessing and manipulating HTML documents. The DOM represents an HTML document as a tree structure. ## HTML DOM Tree Example ![Image 2: DOM HTML tree](#) * * * ## How to Learn JavaScript? (#) (#) (#)
← Web XmlMisc Each β†’