It is a brief about JavaScript, To make understand the development and phases of development JavaScript.
It is helpful for beginner as well as intermediate level.
If you like it please comment or like for more updates.
Thanks
1. VB.NET is an object-oriented programming language implemented on the .NET Framework. It has full support for object-oriented concepts and inherits from the base Object class.
2. The .NET Framework provides a comprehensive library for developing all kinds of VB.NET programs from simple console apps to complex applications. Visual Studio is a popular IDE used for writing VB.NET code.
3. A basic VB.NET program structure includes namespace declaration, class/module, procedures like Main, variables, statements, and comments. The Main procedure acts as the entry point.
Introduction to JavaScript course. The course was updated in 2014-15.
Will allow you to understand what is JavaScript, what's it history and how you can use it.
The set of slides "Introduction to jQuery" is a follow up - which would allow the reader to have a basic understanding across JavaScript and jQuery.
We are covering following topics:
If...Else...Elseif Statements: if statement executes some code if one condition is true.
Switch Statement: Switch Statement tests a variable against a series of values.
For Loop: For loop executes a block of code a specified number of times.
While Loop: While loop executes a block of code as long as the specified condition is true.
Do…While Loop: Do...While loop will always execute the block of code once, it will then check the condition, and repeat the loop while the specified condition is true.
The document discusses different types of repetition statements in Java including while, do-while, and for loops. It provides examples of each loop type and how they work. It also covers nested loops, infinite loops, and different ways to control loop repetition including using counters, sentinels, and flags. There are examples provided for each concept along with expected output. At the end, there are three exercises presented with questions about the output or behavior of short code examples using various loop structures.
HTML offers three types of lists: unordered lists (<ul>), ordered lists (<ol>), and description lists (<dl>). Unordered lists use bullet points, ordered lists use numbers, and description lists consist of terms (<dt>) and their associated descriptions (<dd>). Lists provide a way to group related items and HTML offers attributes like type and start to customize numbering and bullets.
Introduction to visual basic programmingRoger Argarin
The document outlines a course on Visual Basic programming using Visual Studio .NET2005. It introduces Visual Basic and its history, covers basic concepts like object-oriented programming and event-driven programming. It describes setting up the Visual Studio development environment and how to plan and create Visual Basic projects using forms, controls, properties, and code. References and resources are provided to learn more about Visual Basic and .NET programming.
This document provides an introduction to regular expressions (regexes). It explains that regexes describe patterns of text that can be used to search for and replace text. It covers basic regex syntax like literals, wildcards, anchors, quantifiers, character sets, flags, backreferences, and the RegExp object. It also discusses using regexes in JavaScript string methods, text editors, and command line tools.
1. VB.NET is an object-oriented programming language implemented on the .NET Framework. It has full support for object-oriented concepts and inherits from the base Object class.
2. The .NET Framework provides a comprehensive library for developing all kinds of VB.NET programs from simple console apps to complex applications. Visual Studio is a popular IDE used for writing VB.NET code.
3. A basic VB.NET program structure includes namespace declaration, class/module, procedures like Main, variables, statements, and comments. The Main procedure acts as the entry point.
Introduction to JavaScript course. The course was updated in 2014-15.
Will allow you to understand what is JavaScript, what's it history and how you can use it.
The set of slides "Introduction to jQuery" is a follow up - which would allow the reader to have a basic understanding across JavaScript and jQuery.
We are covering following topics:
If...Else...Elseif Statements: if statement executes some code if one condition is true.
Switch Statement: Switch Statement tests a variable against a series of values.
For Loop: For loop executes a block of code a specified number of times.
While Loop: While loop executes a block of code as long as the specified condition is true.
Do…While Loop: Do...While loop will always execute the block of code once, it will then check the condition, and repeat the loop while the specified condition is true.
The document discusses different types of repetition statements in Java including while, do-while, and for loops. It provides examples of each loop type and how they work. It also covers nested loops, infinite loops, and different ways to control loop repetition including using counters, sentinels, and flags. There are examples provided for each concept along with expected output. At the end, there are three exercises presented with questions about the output or behavior of short code examples using various loop structures.
HTML offers three types of lists: unordered lists (<ul>), ordered lists (<ol>), and description lists (<dl>). Unordered lists use bullet points, ordered lists use numbers, and description lists consist of terms (<dt>) and their associated descriptions (<dd>). Lists provide a way to group related items and HTML offers attributes like type and start to customize numbering and bullets.
Introduction to visual basic programmingRoger Argarin
The document outlines a course on Visual Basic programming using Visual Studio .NET2005. It introduces Visual Basic and its history, covers basic concepts like object-oriented programming and event-driven programming. It describes setting up the Visual Studio development environment and how to plan and create Visual Basic projects using forms, controls, properties, and code. References and resources are provided to learn more about Visual Basic and .NET programming.
This document provides an introduction to regular expressions (regexes). It explains that regexes describe patterns of text that can be used to search for and replace text. It covers basic regex syntax like literals, wildcards, anchors, quantifiers, character sets, flags, backreferences, and the RegExp object. It also discusses using regexes in JavaScript string methods, text editors, and command line tools.
The document provides an introduction to HTML (Hypertext Markup Language), covering basic HTML tags and elements used to structure and format text on web pages. It explains that HTML is not a programming language but a markup language used to define the structure of a web page. The document lists common HTML tags for headings, paragraphs, line breaks, comments, and other text elements, and provides examples of how each tag is structured and displayed in a web browser. It also covers attributes that provide additional styling information for elements.
This document provides an overview of Visual Basic .NET (VB.NET):
- VB.NET is an object-oriented programming language developed by Microsoft that is implemented on the .NET framework. It is not backwards compatible with older VB versions.
- VB.NET supports object-oriented concepts and everything is an object that inherits from the base Object class. It has full access to libraries in the .NET Framework.
- The .NET Framework consists of components like the Common Language Runtime and Class Library that enable multi-platform applications to be developed from languages like VB.NET.
The document introduces programming and the C++ language. It explains that a program is a set of instructions given to a computer in a programming language to perform tasks. High-level languages like C++ were created because computers only understand binary and it is impossible for humans to program in binary. The document then covers the anatomy of a simple "Hello World" C++ program, including main functions, header files, output statements, strings, and terminators. It concludes by explaining how C++ source code is compiled into machine code and executed.
JavaScript can dynamically manipulate the content, structure, and styling of an HTML document through the Document Object Model (DOM). The DOM represents an HTML document as nodes that can be accessed and modified with JavaScript. Common tasks include dynamically creating and adding elements, handling user events like clicks, and updating content by accessing DOM elements by their id or other attributes.
The document outlines a lesson plan for teaching C++ programming. It discusses using basic tools like labels, textboxes, buttons and message boxes to create a simple program. Students will work in groups of three to make a program that displays information about members using these basic tools. The lesson teaches object-oriented programming concepts like classes and objects as well as C++ syntax. It evaluates students and assigns follow-up work to reinforce the learning objectives.
CSS (Cascading Style Sheets) is a markup language used to style and lay out web documents. There are three types of CSS: external style sheets, internal style sheets, and inline styles. External style sheets are ideal for applying styles to many pages, internal style sheets are used for styling a single document with unique styles, and inline styles are applied directly to HTML elements but lose advantages of style sheets.
This document provides information about programming fundamentals including definitions of computer hardware, software, operating systems, compilers, interpreters, source code, and text editors. It discusses how computer hardware refers to physical components like the monitor, keyboard, and CPU, and how software includes programs that direct the computer's processor. It also summarizes the differences between compilers and interpreters in processing source code.
This document discusses HTML text formatting tags. It provides examples of common text formatting tags like <b> for bold, <i> for italics, and <u> for underline. It also covers font tags like <font> for changing font attributes like size, type, and color. The document is intended to teach a class on HTML text formatting tags and previews that the next class will cover image, link, and list tags.
Forms allow users to enter data into a website. They contain form elements like text fields, drop-down menus, and buttons. The <form> element defines a form, while <input>, <textarea>, <select>, and <button> elements create specific form controls. Forms submit data via GET or POST requests, and attributes like action, method, and target control submission. Common elements include single-line text, passwords, textareas, checkboxes, radio buttons, drop-downs, file uploads, hidden fields, and submit/reset buttons.
Visual Basic is a tool for developing Windows GUI applications. It is event-driven, meaning code only runs in response to events like button clicks. Developers draw the user interface, assign control properties, and attach code to events. The interface has modes for design, running, and debugging applications. Key windows include the form, toolbox, properties, and code editor. Variables follow naming conventions and have different scopes depending on where they are declared.
HTML is a markup language used to define the structure and layout of web pages. It uses tags like <h1> and <p> to mark headings and paragraphs. CSS is used to style and lay out HTML elements, using selectors, declarations, and properties to change things like colors and positioning. JavaScript can be added to HTML pages with <script> tags and is used to add interactive elements and dynamic behavior by manipulating HTML and responding to user input. It has data types like strings and numbers and control structures like if/else statements.
This document provides an introduction and overview of PHP and MySQL. PHP is a programming language used for building dynamic web sites. It allows embedding code within HTML pages to quickly create dynamic content. PHP is processed on the server side to produce HTML results. The document outlines PHP basics like syntax, variables, strings, operators, and conditional statements. It also discusses MySQL, the most popular database used with PHP. The document concludes with exercises for users to practice basic PHP concepts.
Web Visualization with HTML5, CSS3, and JavaScript is the course with the rapidly changing web development technologies, it has become important to stay in line with them to progress within the industry, which is why this course in web virtualization has been brought to you to spruce up your web designing and animating skills using HTML5, CSS3, and JavaScript. The latest features of HTML5, CSS3 and JavaScript are set to be provided to you through this course, hence, it is desired that you have basic knowledge on these programming languages for a smoother learning experience. This course will start off by walking you through the CSS3 virtualization techniques to design and animate webs. You will be taught how to create a 3D element using CSS transition and to transform animates into 2D and 3D, along with an insight into the elements of scalable vector graphics which is needed to create basic images and polygons and to animate. Our tutors will further take you through the canvas aspects of HTML5 to start drawing grids and animations using it. You will also get to learn how to create a callback and create and activate a queue that is needed in animating and the animation libraries that will be essential to your web designing projects. By the end of this course, you will have an outstanding knowledge of web visualization using HTML5, CSS3, and JavaScript to secure yourself a prominent place within the web development industry.
To understand algorithm and flowchart, it is better to refer this Slideshare that I have created. I have thoroughly presented the key points that make easy in remembering what algorithm and flowchart is. The slide is really simple and wonderful to use it for a quick reference.
Computer Hardware - Platforms and Technologieselectricgeisha
Computer hardware refers to the physical parts of a computer and includes components like the processor, memory, storage, and input/output devices. It differs from software which are programs that run on the hardware. Common types of hardware include motherboards, RAM, hard disks, CD/DVD drives, flash memory, ports, and peripherals like monitors, keyboards, and printers. Hardware is necessary to store and process the data and instructions of software.
This document provides an overview of JavaScript, including:
- JavaScript is a client-side scripting language designed for web pages that enhances HTML with dynamic and interactive features.
- It was initially developed by Netscape as LiveScript but was renamed JavaScript and standardized along with Java.
- JavaScript can react to events, validate data, detect the browser, create cookies, and read/write HTML elements.
- Key JavaScript concepts covered include objects, properties, methods, functions, values, variables, and the HTML DOM for finding and manipulating elements.
This document provides an overview of the web and web design. It discusses the difference between the Internet and the World Wide Web, and how web browsers access web pages from the Internet. There are different types of websites, including commercial, portal, informational, educational, and personal sites. Web pages contain various elements like text, graphics, multimedia, and hyperlinks that link pages together. The web design process involves interaction, information, and presentation design. It also identifies careers in web authoring, design, development, and webmastering.
This document discusses JavaScript data types including numbers, strings, Booleans, objects, undefined, and null. It notes that JavaScript is a dynamically typed language where variables do not need to be declared. The key data types are described, for example numbers can be integers or floats, strings are immutable sequences of characters, Booleans have two values of true or false, and objects store keyed collections of values that can be changed. The differences between null and undefined are presented as a question for an exercise.
HTML is the standard markup language used to create web pages. HTML uses tags to label content such as headings, paragraphs, lists, and tables. Tags are keywords surrounded by angle brackets and most have an opening and closing tag. Common HTML tags are used to create headings, paragraphs, lists, line breaks, horizontal rules, bold, underline, italic and strong text. The basic HTML page structure includes <html>, <head>, <body> tags.
JavaScript can change HTML content, attributes, styles, and validate data. It can be placed in the <body> and <head> sections between <script> tags. Functions and events allow JavaScript code to run when events occur. JavaScript can output to alerts, the document, elements, and the console. It uses data types like numbers, strings, Booleans, arrays, and objects. Conditionals like if/else and switch statements allow different code blocks to run based on conditions. Loops like for, for/in, while, and do/while repeat code.
JavaScript is an object-oriented scripting language used to make webpages interactive. It is lightweight and commonly used as part of web pages. JavaScript can be used to validate user input, provide immediate feedback, and increase interactivity. JavaScript code can output data by writing to HTML elements, using alerts, or writing to the browser console. Key JavaScript concepts include variables, functions, objects, and arrays for storing and manipulating different types of data.
The document provides an introduction to HTML (Hypertext Markup Language), covering basic HTML tags and elements used to structure and format text on web pages. It explains that HTML is not a programming language but a markup language used to define the structure of a web page. The document lists common HTML tags for headings, paragraphs, line breaks, comments, and other text elements, and provides examples of how each tag is structured and displayed in a web browser. It also covers attributes that provide additional styling information for elements.
This document provides an overview of Visual Basic .NET (VB.NET):
- VB.NET is an object-oriented programming language developed by Microsoft that is implemented on the .NET framework. It is not backwards compatible with older VB versions.
- VB.NET supports object-oriented concepts and everything is an object that inherits from the base Object class. It has full access to libraries in the .NET Framework.
- The .NET Framework consists of components like the Common Language Runtime and Class Library that enable multi-platform applications to be developed from languages like VB.NET.
The document introduces programming and the C++ language. It explains that a program is a set of instructions given to a computer in a programming language to perform tasks. High-level languages like C++ were created because computers only understand binary and it is impossible for humans to program in binary. The document then covers the anatomy of a simple "Hello World" C++ program, including main functions, header files, output statements, strings, and terminators. It concludes by explaining how C++ source code is compiled into machine code and executed.
JavaScript can dynamically manipulate the content, structure, and styling of an HTML document through the Document Object Model (DOM). The DOM represents an HTML document as nodes that can be accessed and modified with JavaScript. Common tasks include dynamically creating and adding elements, handling user events like clicks, and updating content by accessing DOM elements by their id or other attributes.
The document outlines a lesson plan for teaching C++ programming. It discusses using basic tools like labels, textboxes, buttons and message boxes to create a simple program. Students will work in groups of three to make a program that displays information about members using these basic tools. The lesson teaches object-oriented programming concepts like classes and objects as well as C++ syntax. It evaluates students and assigns follow-up work to reinforce the learning objectives.
CSS (Cascading Style Sheets) is a markup language used to style and lay out web documents. There are three types of CSS: external style sheets, internal style sheets, and inline styles. External style sheets are ideal for applying styles to many pages, internal style sheets are used for styling a single document with unique styles, and inline styles are applied directly to HTML elements but lose advantages of style sheets.
This document provides information about programming fundamentals including definitions of computer hardware, software, operating systems, compilers, interpreters, source code, and text editors. It discusses how computer hardware refers to physical components like the monitor, keyboard, and CPU, and how software includes programs that direct the computer's processor. It also summarizes the differences between compilers and interpreters in processing source code.
This document discusses HTML text formatting tags. It provides examples of common text formatting tags like <b> for bold, <i> for italics, and <u> for underline. It also covers font tags like <font> for changing font attributes like size, type, and color. The document is intended to teach a class on HTML text formatting tags and previews that the next class will cover image, link, and list tags.
Forms allow users to enter data into a website. They contain form elements like text fields, drop-down menus, and buttons. The <form> element defines a form, while <input>, <textarea>, <select>, and <button> elements create specific form controls. Forms submit data via GET or POST requests, and attributes like action, method, and target control submission. Common elements include single-line text, passwords, textareas, checkboxes, radio buttons, drop-downs, file uploads, hidden fields, and submit/reset buttons.
Visual Basic is a tool for developing Windows GUI applications. It is event-driven, meaning code only runs in response to events like button clicks. Developers draw the user interface, assign control properties, and attach code to events. The interface has modes for design, running, and debugging applications. Key windows include the form, toolbox, properties, and code editor. Variables follow naming conventions and have different scopes depending on where they are declared.
HTML is a markup language used to define the structure and layout of web pages. It uses tags like <h1> and <p> to mark headings and paragraphs. CSS is used to style and lay out HTML elements, using selectors, declarations, and properties to change things like colors and positioning. JavaScript can be added to HTML pages with <script> tags and is used to add interactive elements and dynamic behavior by manipulating HTML and responding to user input. It has data types like strings and numbers and control structures like if/else statements.
This document provides an introduction and overview of PHP and MySQL. PHP is a programming language used for building dynamic web sites. It allows embedding code within HTML pages to quickly create dynamic content. PHP is processed on the server side to produce HTML results. The document outlines PHP basics like syntax, variables, strings, operators, and conditional statements. It also discusses MySQL, the most popular database used with PHP. The document concludes with exercises for users to practice basic PHP concepts.
Web Visualization with HTML5, CSS3, and JavaScript is the course with the rapidly changing web development technologies, it has become important to stay in line with them to progress within the industry, which is why this course in web virtualization has been brought to you to spruce up your web designing and animating skills using HTML5, CSS3, and JavaScript. The latest features of HTML5, CSS3 and JavaScript are set to be provided to you through this course, hence, it is desired that you have basic knowledge on these programming languages for a smoother learning experience. This course will start off by walking you through the CSS3 virtualization techniques to design and animate webs. You will be taught how to create a 3D element using CSS transition and to transform animates into 2D and 3D, along with an insight into the elements of scalable vector graphics which is needed to create basic images and polygons and to animate. Our tutors will further take you through the canvas aspects of HTML5 to start drawing grids and animations using it. You will also get to learn how to create a callback and create and activate a queue that is needed in animating and the animation libraries that will be essential to your web designing projects. By the end of this course, you will have an outstanding knowledge of web visualization using HTML5, CSS3, and JavaScript to secure yourself a prominent place within the web development industry.
To understand algorithm and flowchart, it is better to refer this Slideshare that I have created. I have thoroughly presented the key points that make easy in remembering what algorithm and flowchart is. The slide is really simple and wonderful to use it for a quick reference.
Computer Hardware - Platforms and Technologieselectricgeisha
Computer hardware refers to the physical parts of a computer and includes components like the processor, memory, storage, and input/output devices. It differs from software which are programs that run on the hardware. Common types of hardware include motherboards, RAM, hard disks, CD/DVD drives, flash memory, ports, and peripherals like monitors, keyboards, and printers. Hardware is necessary to store and process the data and instructions of software.
This document provides an overview of JavaScript, including:
- JavaScript is a client-side scripting language designed for web pages that enhances HTML with dynamic and interactive features.
- It was initially developed by Netscape as LiveScript but was renamed JavaScript and standardized along with Java.
- JavaScript can react to events, validate data, detect the browser, create cookies, and read/write HTML elements.
- Key JavaScript concepts covered include objects, properties, methods, functions, values, variables, and the HTML DOM for finding and manipulating elements.
This document provides an overview of the web and web design. It discusses the difference between the Internet and the World Wide Web, and how web browsers access web pages from the Internet. There are different types of websites, including commercial, portal, informational, educational, and personal sites. Web pages contain various elements like text, graphics, multimedia, and hyperlinks that link pages together. The web design process involves interaction, information, and presentation design. It also identifies careers in web authoring, design, development, and webmastering.
This document discusses JavaScript data types including numbers, strings, Booleans, objects, undefined, and null. It notes that JavaScript is a dynamically typed language where variables do not need to be declared. The key data types are described, for example numbers can be integers or floats, strings are immutable sequences of characters, Booleans have two values of true or false, and objects store keyed collections of values that can be changed. The differences between null and undefined are presented as a question for an exercise.
HTML is the standard markup language used to create web pages. HTML uses tags to label content such as headings, paragraphs, lists, and tables. Tags are keywords surrounded by angle brackets and most have an opening and closing tag. Common HTML tags are used to create headings, paragraphs, lists, line breaks, horizontal rules, bold, underline, italic and strong text. The basic HTML page structure includes <html>, <head>, <body> tags.
JavaScript can change HTML content, attributes, styles, and validate data. It can be placed in the <body> and <head> sections between <script> tags. Functions and events allow JavaScript code to run when events occur. JavaScript can output to alerts, the document, elements, and the console. It uses data types like numbers, strings, Booleans, arrays, and objects. Conditionals like if/else and switch statements allow different code blocks to run based on conditions. Loops like for, for/in, while, and do/while repeat code.
JavaScript is an object-oriented scripting language used to make webpages interactive. It is lightweight and commonly used as part of web pages. JavaScript can be used to validate user input, provide immediate feedback, and increase interactivity. JavaScript code can output data by writing to HTML elements, using alerts, or writing to the browser console. Key JavaScript concepts include variables, functions, objects, and arrays for storing and manipulating different types of data.
JavaScript was designed to add interactivity to HTML pages. It is a scripting language that is usually embedded directly into HTML pages and allows for dynamic text, event handling, reading/writing HTML elements, and validating form data. JavaScript supports both client-side and server-side scripting and was originally developed by Netscape under the name LiveScript before being renamed. It provides programming capabilities to HTML authors and allows for dynamic content, user interaction, and validation without server requests.
This document provides an introduction to JavaScript including:
1. JavaScript is a client-side scripting language that adds interactivity to HTML pages. It is embedded directly into HTML and allows dynamic updating of content.
2. The document covers JavaScript syntax, variables, data types, functions, objects, arrays, strings, dates and more. It provides examples of how to declare variables, write functions, create objects and arrays, and manipulate strings and dates.
3. Methods for output, variable scope, and built-in objects like String, Array, Math and Date are described. The DOM (Document Object Model) and form validation using JavaScript are also mentioned.
This document provides an overview of JavaScript, including:
- JavaScript is not related to Java and was originally called LiveScript.
- JavaScript code is run in web browsers by an interpreter built into the browser, not on servers.
- JavaScript can be used to add interactivity to HTML pages by including <script> tags and running code when pages load or in response to user events.
- JavaScript functions and variables can be defined and used to manipulate the DOM and handle user interactions.
JavaScript is a lightweight, interpreted programming language that runs in web browsers. It was introduced in 1995 to enable dynamic interactivity on web pages. JavaScript is used to add interactive effects and validate forms on web pages. It is an object-based scripting language that is used to make web pages dynamic. Some key features of JavaScript include being event-driven, platform independent, enabling quick development, and being relatively easy to learn. JavaScript uses variables, operators, functions, and objects to manipulate web page elements and interact with users.
JavaScript was originally created as LiveScript in 1995 and renamed to JavaScript. It is an interpreted scripting language that can be added to HTML pages to provide dynamic interactivity. JavaScript code is executed by the browser's JavaScript engine and does not need to be compiled. It allows manipulating the structure, style, and content of HTML documents, validating form data, detecting browser capabilities, and much more.
This document provides an overview of JavaScript, including:
- JavaScript is an interpreted programming language used to enhance websites through dynamic content and logic without page refreshes. It has no relation to Java.
- JavaScript can be added inline in HTML or through external files and is typically placed in the <head> section. It is case sensitive.
- Core JavaScript concepts covered include variables, arrays, conditional statements, loops, functions, objects, cookies, dates, math functions, and regular expressions.
- Asynchronous JavaScript and XML (AJAX) allows dynamic updating of web pages using the XMLHttpRequest object to communicate with servers in the background.
This document provides an introduction to JavaScript, covering topics such as:
- The scope of the lesson includes an introduction to JavaScript, using JavaScript code, syntax, data types, objects, strings, functions, and standard popup boxes.
- JavaScript is a client-side scripting language that allows interactivity on web pages by modifying HTML content and handling events. It is interpreted by web browsers rather than compiled.
- JavaScript code can be embedded directly in HTML, or linked via external .js files, and is executed when the page loads or in response to events.
The document provides an overview of JavaScript objects, functions, and data types. It discusses that JavaScript objects can contain properties and almost everything in JavaScript is an object. Functions are blocks of reusable code that perform tasks when invoked. JavaScript supports primitive data types like strings, numbers, Booleans as well as complex types like objects, arrays. It provides examples and explanations of how to work with each of these concepts in JavaScript.
JavaScript is a client-side scripting language that allows web pages to become interactive and dynamic. It can update and modify the content of an HTML page without needing to reload the page. JavaScript code can be embedded directly in HTML pages or placed in separate .js files. Common uses of JavaScript include validating form input, detecting the visitor's browser, creating cookies, and adding interactivity to HTML elements like buttons and links.
- JavaScript is a client-side scripting language used to validate data and embed scripts in HTML documents using the <SCRIPT> tag. It was developed by Brendan Eich and is supported by most browsers.
- Functions, variables, operators, and control structures work similarly in JavaScript as in C++. Common data types include numbers, strings, and Booleans. Functions are defined using the function keyword.
- Built-in functions like alert(), prompt(), and document.write() are used for output. Events like onclick trigger JavaScript execution. Arrays and objects allow storing multiple values.
JavaScript is a client-side scripting language that can be inserted into HTML pages to make them interactive. It allows dynamic validation of forms, changing HTML element properties like visibility, and reacting to user events like clicks or form submissions. The Document Object Model (DOM) represents an HTML or XML document as a tree structure, allowing JavaScript to programmatically access and modify the content, structure, and styling of the document. Common built-in JavaScript objects include String, Date, Array, Math, and Boolean, which provide properties and methods for manipulating text, dates, lists of values, numbers, and true/false values.
JavaScript is a versatile programming language used for developing interactive websites. It allows for dynamic content, form validation, and client-side functionality. With frameworks like React and Angular, it enables the creation of complex web applications, making it a crucial tool in modern web development.
JavaScript is a versatile programming language used for developing interactive websites. It allows for dynamic content, form validation, and client-side functionality. With frameworks like React and Angular, it enables the creation of complex web applications, making it a crucial tool in modern web development.
The document provides an outline and introduction to JavaScript concepts including variables, functions, conditions, loops, pop-up boxes, objects, and the Document Object Model (DOM). It discusses tasks performed by client-side scripts like form validation, event handling, and dynamic page updates. It also compares client-side and server-side scripting, noting that client-side scripts execute on the browser and allow for interactivity but cannot access local files or databases.
This document provides an overview of HTML, CSS, and JavaScript for web development. It discusses the basics of each technology, how they work together, and includes the following key points:
- HTML is the markup language that defines the structure and content of a web page. CSS is used to style and lay out elements on the page. JavaScript adds interactive functionality.
- Events, functions, and variables are important JavaScript concepts. Events trigger actions, functions contain reusable code, and variables store and retrieve data.
- CSS selectors allow styling elements by type, class, ID, and other attributes. The box model, positioning, and other properties control layout.
- Common debugging tools like Firebug help
This document provides an introduction to JavaScript including:
- JavaScript is the most popular programming language for adding interactivity to web pages.
- It is embedded directly into HTML and is case-sensitive.
- JavaScript can change HTML content, attributes, styles, validate data, and display pop-ups.
- The <script> tag is used to insert JavaScript into HTML. Scripts can go in the head or body.
- External JavaScript files allow code reuse across pages and improve performance.
- JavaScript outputs can be written to alerts, the page, elements, and the console.
- Variables, data types, operators, functions, conditional statements, loops, arrays and events are also introduced.
JavaScript is a scripting language used to add interactivity to HTML pages. It allows dynamic updating of web page content without reloading the page. JavaScript code can be added inline, embedded, or externally linked in HTML pages. Common JavaScript elements include objects, properties, methods, events, functions, variables, expressions, conditions, loops, and arrays. The DOM (Document Object Model) represents HTML documents and allows JavaScript to access and modify elements dynamically. Cookies are used by JavaScript to store and retrieve information on the client-side.
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsVictor Morales
K8sGPT is a tool that analyzes and diagnoses Kubernetes clusters. This presentation was used to share the requirements and dependencies to deploy K8sGPT in a local environment.
Advanced control scheme of doubly fed induction generator for wind turbine us...IJECEIAES
This paper describes a speed control device for generating electrical energy on an electricity network based on the doubly fed induction generator (DFIG) used for wind power conversion systems. At first, a double-fed induction generator model was constructed. A control law is formulated to govern the flow of energy between the stator of a DFIG and the energy network using three types of controllers: proportional integral (PI), sliding mode controller (SMC) and second order sliding mode controller (SOSMC). Their different results in terms of power reference tracking, reaction to unexpected speed fluctuations, sensitivity to perturbations, and resilience against machine parameter alterations are compared. MATLAB/Simulink was used to conduct the simulations for the preceding study. Multiple simulations have shown very satisfying results, and the investigations demonstrate the efficacy and power-enhancing capabilities of the suggested control system.
Using recycled concrete aggregates (RCA) for pavements is crucial to achieving sustainability. Implementing RCA for new pavement can minimize carbon footprint, conserve natural resources, reduce harmful emissions, and lower life cycle costs. Compared to natural aggregate (NA), RCA pavement has fewer comprehensive studies and sustainability assessments.
Comparative analysis between traditional aquaponics and reconstructed aquapon...bijceesjournal
The aquaponic system of planting is a method that does not require soil usage. It is a method that only needs water, fish, lava rocks (a substitute for soil), and plants. Aquaponic systems are sustainable and environmentally friendly. Its use not only helps to plant in small spaces but also helps reduce artificial chemical use and minimizes excess water use, as aquaponics consumes 90% less water than soil-based gardening. The study applied a descriptive and experimental design to assess and compare conventional and reconstructed aquaponic methods for reproducing tomatoes. The researchers created an observation checklist to determine the significant factors of the study. The study aims to determine the significant difference between traditional aquaponics and reconstructed aquaponics systems propagating tomatoes in terms of height, weight, girth, and number of fruits. The reconstructed aquaponics system’s higher growth yield results in a much more nourished crop than the traditional aquaponics system. It is superior in its number of fruits, height, weight, and girth measurement. Moreover, the reconstructed aquaponics system is proven to eliminate all the hindrances present in the traditional aquaponics system, which are overcrowding of fish, algae growth, pest problems, contaminated water, and dead fish.
Batteries -Introduction – Types of Batteries – discharging and charging of battery - characteristics of battery –battery rating- various tests on battery- – Primary battery: silver button cell- Secondary battery :Ni-Cd battery-modern battery: lithium ion battery-maintenance of batteries-choices of batteries for electric vehicle applications.
Fuel Cells: Introduction- importance and classification of fuel cells - description, principle, components, applications of fuel cells: H2-O2 fuel cell, alkaline fuel cell, molten carbonate fuel cell and direct methanol fuel cells.
Embedded machine learning-based road conditions and driving behavior monitoringIJECEIAES
Car accident rates have increased in recent years, resulting in losses in human lives, properties, and other financial costs. An embedded machine learning-based system is developed to address this critical issue. The system can monitor road conditions, detect driving patterns, and identify aggressive driving behaviors. The system is based on neural networks trained on a comprehensive dataset of driving events, driving styles, and road conditions. The system effectively detects potential risks and helps mitigate the frequency and impact of accidents. The primary goal is to ensure the safety of drivers and vehicles. Collecting data involved gathering information on three key road events: normal street and normal drive, speed bumps, circular yellow speed bumps, and three aggressive driving actions: sudden start, sudden stop, and sudden entry. The gathered data is processed and analyzed using a machine learning system designed for limited power and memory devices. The developed system resulted in 91.9% accuracy, 93.6% precision, and 92% recall. The achieved inference time on an Arduino Nano 33 BLE Sense with a 32-bit CPU running at 64 MHz is 34 ms and requires 2.6 kB peak RAM and 139.9 kB program flash memory, making it suitable for resource-constrained embedded systems.
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELgerogepatton
As digital technology becomes more deeply embedded in power systems, protecting the communication
networks of Smart Grids (SG) has emerged as a critical concern. Distributed Network Protocol 3 (DNP3)
represents a multi-tiered application layer protocol extensively utilized in Supervisory Control and Data
Acquisition (SCADA)-based smart grids to facilitate real-time data gathering and control functionalities.
Robust Intrusion Detection Systems (IDS) are necessary for early threat detection and mitigation because
of the interconnection of these networks, which makes them vulnerable to a variety of cyberattacks. To
solve this issue, this paper develops a hybrid Deep Learning (DL) model specifically designed for intrusion
detection in smart grids. The proposed approach is a combination of the Convolutional Neural Network
(CNN) and the Long-Short-Term Memory algorithms (LSTM). We employed a recent intrusion detection
dataset (DNP3), which focuses on unauthorized commands and Denial of Service (DoS) cyberattacks, to
train and test our model. The results of our experiments show that our CNN-LSTM method is much better
at finding smart grid intrusions than other deep learning algorithms used for classification. In addition,
our proposed approach improves accuracy, precision, recall, and F1 score, achieving a high detection
accuracy rate of 99.50%.
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTjpsjournal1
The rivalry between prominent international actors for dominance over Central Asia's hydrocarbon
reserves and the ancient silk trade route, along with China's diplomatic endeavours in the area, has been
referred to as the "New Great Game." This research centres on the power struggle, considering
geopolitical, geostrategic, and geoeconomic variables. Topics including trade, political hegemony, oil
politics, and conventional and nontraditional security are all explored and explained by the researcher.
Using Mackinder's Heartland, Spykman Rimland, and Hegemonic Stability theories, examines China's role
in Central Asia. This study adheres to the empirical epistemological method and has taken care of
objectivity. This study analyze primary and secondary research documents critically to elaborate role of
china’s geo economic outreach in central Asian countries and its future prospect. China is thriving in trade,
pipeline politics, and winning states, according to this study, thanks to important instruments like the
Shanghai Cooperation Organisation and the Belt and Road Economic Initiative. According to this study,
China is seeing significant success in commerce, pipeline politics, and gaining influence on other
governments. This success may be attributed to the effective utilisation of key tools such as the Shanghai
Cooperation Organisation and the Belt and Road Economic Initiative.
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...IJECEIAES
Medical image analysis has witnessed significant advancements with deep learning techniques. In the domain of brain tumor segmentation, the ability to
precisely delineate tumor boundaries from magnetic resonance imaging (MRI)
scans holds profound implications for diagnosis. This study presents an ensemble convolutional neural network (CNN) with transfer learning, integrating
the state-of-the-art Deeplabv3+ architecture with the ResNet18 backbone. The
model is rigorously trained and evaluated, exhibiting remarkable performance
metrics, including an impressive global accuracy of 99.286%, a high-class accuracy of 82.191%, a mean intersection over union (IoU) of 79.900%, a weighted
IoU of 98.620%, and a Boundary F1 (BF) score of 83.303%. Notably, a detailed comparative analysis with existing methods showcases the superiority of
our proposed model. These findings underscore the model’s competence in precise brain tumor localization, underscoring its potential to revolutionize medical
image analysis and enhance healthcare outcomes. This research paves the way
for future exploration and optimization of advanced CNN models in medical
imaging, emphasizing addressing false positives and resource efficiency.
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
Javascript
1.
2. Definition
• JavaScript is a loosely-typed client side scripting language that
executes in the user's browser.
• It interact with html elements in order to make interactive web user
interface.
• It allows the user to perform calculations, check forms, write
interactive games, add special effects, customize graphics selections,
create security passwords and more.
• It can be used in various activities like data validation, display popup
messages, handling different events , etc,.
3. Advantages of JavaScript:
• It executes on client's browser, so eliminates server side processing.
• It executes on any OS.
• JavaScript can be used with any type of web page e.g. PHP, ASP.NET,
Perl etc.
• Performance of web page increases due to client side execution.
• JavaScript code can be minified to decrease loading time from server.
4. JavaScript Overview
• Character Set: It uses the Unicode character set and so allows almost all
characters, punctuations, and symbols.
• Case Sensitive: It is a case sensitive scripting language. It means functions,
variables and keywords are case sensitive.
• String: String is a text in JavaScript. A text content must be enclosed in double
or single quotation marks.
• Number: It allows you to work with any kind of numbers like integer, float,
hexadecimal etc. Number must NOT be wrapped in quotation marks.
• Semicolon : It is Separated by a semicolon. However, it is not mandatory to end
every statement with a semicolon but it is recommended.
• White space: JavaScript ignores multiple spaces and tabs
5. JavaScript in HTML
• JavaScript code must be inserted between <script> and </script> tags.
• The script tag identifies a block of script code in the html page.
• It also loads a script file with src attribute.
• Scripts can be placed in the <body>, or in the <head> section of an HTML
page, or in both.
Example:
<script>
//Javascript codes..
</script>
6. External Script file
• External scripts are also used when the same code is used in many
different web pages.
• JavaScript files have the file extension .js.
• Advantages:
• It separates HTML and code
• Cached JavaScript files can speed up page loads
<script src="/PathToScriptFile.js"></<script>
<body>
<script src="myScript.js"></script>
</body>
function myFunction() {
document.getElementById("demo").innerHTML =
"Paragraph changed.";
}
myScript.js
HTML File
Example :
7. JavaScript Display
•Writing into an alert box, using window.alert().
•Writing into the HTML output using document.write().
•Writing into an HTML element, using innerHTML.
•The id attribute defines the HTML element.
• The innerHTML property defines the HTML content
•Writing into the browser console, using console.log().
•Activate the browser console with F12, and select "Console" in the menu.
<script>
window.alert(4 + 6);
</script>
<script>
document.write(1 + 6);
</script>
<script>
document.getElementById("demo").innerHTML =5 + 6;
</script>
<script>
console.log(5 + 6);
</script>
(For testing purposes)
9. Operators
• typeof Operator:
• The typeof operator is a unary operator that is placed before its single operand,
which can be of any type.
• It evaluates to "number", "string", or "Boolean" if its operand is a number, string,
or Boolean value and returns true or false based on the evaluation.
result = (typeof b == "string" ? "B is String" : "B is Numeric");
document.write("Result => ");
document.write(result);
document.write(linebreak);
Example:
result = (typeof a == "string" ? "A is String" : "A is Numeric");
document.write("Result => ");
document.write(result);
document.write(linebreak);
var a = 10;
var b = "String";
Result => B is String
Result => A is Numeric
10. STRING
• String value can be assigned to a variable using equal to (=) operator.
• It must be enclosed in single or double quotation marks.
• It can be concatenated using plus (+) operator in JavaScript.
• A string can also be treated like zero index based character array.
• JavaScript also provides you String object to create a string
using new keyword.
var str1 = "Hello World";
var str2 = 'Hello World';
var str = 'We ' + "All" + 'Are ' + 'Alligators';
var str = 'Hello World';
str[0] // H
str[1] // e
str[2] // l
str.length // 11
var str1 = new String();
str1 = 'Hello World';
// It returns String object instead of string primitive.
11. Primitive Data Types
Null:
• data type of null is an object.
• null is "nothing".
• It is supposed to be something that doesn't exist. var person = null;
Undefined:
• JavaScript uninitialized variables value are undefined.
• Uninitialized variable (value undefined) equal to null.
• It uninitialized variables Boolean context return false
var str; // Declare variable without value. Identify as undefined value.
document.writeln(str == null); // Returns true
document.writeln(undefined == null); // Returns true
var bool = Boolean(str); // str is undefined passed into Boolean object
document.writeln(bool); // Boolean context Returns false
12. Non-Primitive Data Types
• Object:
• An object can be created in two ways:
• Object literal.
• Object constructor.
• Object Literal:
• The object literal is a simple way of creating an object using { } brackets.
• Use comma (,) to separate multiple key-value pairs.
• Example:
• var emptyObject = {}; // object with no properties or methods
• var person = { firstName: "John" }; // object with single property
Only property or method name without value is not valid.
var person = { firstName }; Wrong One
13. Non-Primitive Data Types
• Object Constructor:
• using new keyword.
• You can attach properties and methods using dot notation.
• Optionally, you can also create properties using [ ] brackets and specifying
property name as string.
Example:
var person = new Object();
// Attach properties and methods to person object
person.firstName = “Thalaivar";
person["lastName"] = “Felix";
person.age = 25;
person.getFullName = function ()
{ return this.firstName + ' ' + this.lastName;
};
// access properties & methods
person.firstName; // Thalaivar
person.lastName; // Felix
person.getFullName(); // Thalaivar Felix
var Alligator = new Object();
Aligator.firstName;
Consider this code alone:
will return 'undefined' if you try to access properties
or call methods that do not exist.
14. Non-Primitive Data Types
• Date:
• provides Date object to work with date & time including days, months, years,
hours, minutes, seconds and milliseconds.
• Example:
var date1 = new Date("3 march 2015");
var date2 = new Date("3 February, 2015");
var date3 = new Date("3rd February, 2015");
var date4 = new Date("2015 3 February");
var date5 = new Date("3 2015 February ");
var date6 = new Date("February 3 2015");
var date7 = new Date("February 2015 3");
var date8 = new Date("3 2 2015");
Tue Mar 03 2015 00:00:00 GMT+0530 (India Standard Time)
Tue Feb 03 2015 00:00:00 GMT+0530 (India Standard Time)
Invalid Date
Tue Feb 03 2015 00:00:00 GMT+0530 (India Standard Time)
Tue Feb 03 2015 00:00:00 GMT+0530 (India Standard Time)
Tue Feb 03 2015 00:00:00 GMT+0530 (India Standard Time)
Tue Feb 03 2015 00:00:00 GMT+0530 (India Standard Time)
Mon Mar 02 2015 00:00:00 GMT+0530 (India Standard Time)
Tue Mar 03 2015 20:21:44 GMT+0530 (India Standard Time)
15. Non-Primitive Data Types
Array:
An array is a special type of variable, which can store multiple values
using special syntax.
An array can be initialized using new keyword.
Example:
var stringArray = ["one", "two", "three"];
var numericArray = [1, 2, 3, 4];
var mixedArray = [1, "two", "three", 4];
var numericArray = new Array(2);
numericArray[0] = 1;
numericArray[1] = 2;
concat() Returns new array by combining values of an array that is specified as parameter with existing array values.
reverse() Reverses the elements of an array. Element at last index will be first and element at 0 index will be last.
shift() Removes the first element from an array and returns that element.
slice() Returns a new array with specified start to end elements.
some() Returns true if at least one element in this array satisfies the condition in the callback function.
sort() Sorts the elements of an array.
Methods:
16. DATATYPES EXAMPLE
var length = 16; // Number
var lastName = "Johnson"; // String
var cars = ["Saab", "Volvo", "BMW"]; // Array
var x = {firstName:"John", lastName:"Doe"}; // Object
var x = "Volvo" + 16 + 4;
Solve It :
var x = 16 + 4 + "Volvo" ;
JavaScript evaluates expressions from left to right.
Volvo164
164Volvo
17. FUNCTIONS
• defined using Function keyword and provides functions similar to
most of the scripting and programming languages.
• A function can have one or more parameters, which will be supplied
by the calling code and can be used inside a function.
• JavaScript is a dynamic type scripting language, so a function
parameter can have value of any data type.
• Functions can also be defined with a built-in JavaScript function
constructor called Function().
Example:
var x = function (a, b)
{return a * b};
This is Function Constructor
var myFunction
= new Function("a", "b", "return a * b");
var x = myFunction(4, 3);
18. FUNCTIONS
• Self-Invoking Functions:
• A self-invoking expression is invoked (started) automatically, without being
called.
• Function expressions will execute automatically if the expression is followed
by ().
• You cannot self-invoke a function declaration.
Example:
(function () {
var x = "Hello!!"; // invoke myself
})();
function myFunction(a, b) {
return a * b;
}
var txt = myFunction.toString();
toString() method returns the function as a string
19. FUNCTIONS WITH ARGUMENTS
function Alligator(firstName, lastName) {
alert("Hello " + firstName + " " + lastName); }
Alligator("Steve", "Jobs", "Mr.");
Alligator("Bill");
Alligator();
display Hello Steve Jobs
display Hello Bill undefined
display Hello undefined undefined
A function can have one or more parameters, which will be supplied by the calling code
and can be used inside a function.
If you pass less arguments then rest of the parameters will be undefined.
If you pass more arguments then additional arguments will be ignored.
can return zero or one value using return keyword.
Example
Example :
function Sum(val1, val2) {
return val1 + val2;
};
20. CONTROL STRUCTURES
• IF CONDITION
• IF ELSE CONDITION
• ELSE IF CONDITION
• SWITCH CONDITION
• WHILE LOOP
• DO WHILE LOOP
• FOR LOOP
• FOR IN LOOP
• CONTINUE STATEMENT
• BREAK STATEMENT
Same Syntax and Same Format as in c#
for (x in person) {
text += person[x];
}
Example for in:
EXCEPTION HANDLING
21. SCOPE
• Scope in JavaScript defines accessibility of variables, objects and functions.
• There are two types of scope in JavaScript.
• Global scope
• Local scope
• Global scope:
• Variables declared outside of any function become global variables.
• Global variables can be accessed and modified from any function.
• Local scope:
• Variables declared inside any function with var keyword are called local variables.
• Local variables cannot be accessed or modified outside the function declaration.
var userName = "Bill";
function modifyUserName() {
userName = "Steve";
};
function createUserName() {
var userName = "Bill"; }
function showUserName() {
alert(userName);
}
createUserName();
showUserName(); // throws error
22. JavaScript Hoisting:
• a variable can be used before it has been declared.
• JavaScript only hoists declarations, not initializations.
• compiler moves all the declarations of variables and functions at the top so that there will
not be any error.
x = 5; // Assign 5 to x
elem = document.getElementById("demo"); // Find an element
elem.innerHTML = x; // Display x in the element
var x; // Declare x
var x = 5; // Initialize x
elem = document.getElementById("demo"); // Find an element
elem.innerHTML = "x is " + x + " and y is " + y; // Display x and y
var y = 7; // Initialize y
Output:
5
Output:
x is 5 and y is undefined
23. JSON
• lightweight data interchange format.
• JSON data is written as name/value pairs.
• A name/value pair consists of a field name (in double quotes), followed by a
colon, followed by a value: "firstName":"John"
• JSON objects are written inside curly braces.
• JSON arrays are written inside square brackets.
• JSON data can be converted into JavaScript Objects using parse method.
JSON Example
-JavaScript Object Notation
{
"employees":[
{"firstName":“Gowtham", "lastName":“raj"},
{"firstName":“Felix", "lastName":“Nirmal"},
]
}
var obj = JSON.parse(text);
24. JAVASCRIPT HTML DOM
• Document Object Model
• When a web page is loaded, the browser creates Document Object Model of the page.
25. Define DOM ?
• The W3C DOM standard is separated into 3 different parts:
• Core DOM - standard model for all document types
• XML DOM - standard model for XML documents
• HTML DOM - standard model for HTML documents
DOM Programming Interface:
• In the DOM, all HTML elements are defined as objects.
• The programming interface is the properties and methods of each object.
• A property is a value that you can get or set (like changing the content of an HTML element).
• A method is an action you can do (like add or deleting an HTML element).
26. Example
<script>
document.getElementById("demo").innerHTML = "Hello World!";
</script>
getElementById is a method, while innerHTML is a property.
The getElementById Method
The most common way to access an HTML element is to use the id of the element.
In the example above the getElementById method used id="demo" to find the
element.
The innerHTML Property
The easiest way to get the content of an element is by using the innerHTML
property.
The innerHTML property is useful for getting or replacing the content of HTML
elements.
27. HTML DOM DOCUMENT OBJECTS
Methods Description
document.getElementById(id) Find an element by element id
document.getElementsByTagName(name) Find elements by tag name
document.getElementsByClassName(name) Find elements by class name
(represents your web page)
Method Description
element.innerHTML = new html
content
Change the inner HTML of an
element
element.attribute = new value Change the attribute value of an
HTML element
element.style.property = new style Change the style of an HTML element
Method Description
document.createElement(element) Create an HTML element
document.removeChild(element) Remove an HTML element
document.appendChild(element) Add an HTML element
document.replaceChild(element) Replace an HTML element
document.write(text) Write into the HTML output stream
Finding HTML Elements
Adding Or Deleting
HTML Elements
Changing HTML
Elements
28. HTML DOM Elements
• Finding HTML elements by id
• Finding HTML elements by tag name
• Finding HTML elements by class name
• Finding HTML elements by CSS selectors
• Finding HTML elements by HTML object collections
var e = document.getElementById("intro");
var x = document.getElementsByTagName("p");
var x = document.getElementsByClassName("intro");
var x = document.querySelectorAll("p.intro");
var x = document.forms["frm1"];
var text = "";
var i;
for (i = 0; i < x.length; i++) {
text += x.elements[i].value + "<br>";
}
document.getElementById("demo").innerHTML = text;
29. GetElementByID() :
<script type="text/javascript">
function getcube(){
var number=document.getElementById("number").value;
alert(number*number*number);
}
</script>
<form>
Enter No:<input type="text" id="number" name="number"/><br/>
<input type="button" value="cube" onclick="getcube()"/>
</form>
The document.getElementById() method
returns the element of specified id.
30. GetElementsByName() :
<script type="text/javascript">
function totalelements()
{
var allgenders=document.getElementsByName("gender");
alert("Total Genders:"+allgenders.length);
}
</script>
<form>
Male:<input type="radio" name="gender" value="male">
Female:<input type="radio" name="gender" value="female">
<input type="button" onclick="totalelements()" value="Total
Genders">
</form>
The document.getElementsByName() method
returns all the element of specified name.
31. GetElementsByTagName() :
<script type="text/javascript">
function countpara(){
var totalpara=document.getElementsByTagName("p");
alert("total p tags are: "+totalpara.length);
}
</script>
<p>This is a pragraph</p>
<p>Here we are going to count total number of
paragraphs by getElementByTagName() method.</p>
<p>Let's see the simple example</p>
<button onclick="countpara()">count paragraph</button>
The document.getElementsByTagName() method
returns all the element of specified tag name.
32. innerHTML property :
<script type="text/javascript" >
function showcommentform() {
var data="Name:<input type='text' name='name'><br>
Comment:<br><textarea rows='5' cols='80'></textarea>
<br><input type='submit' value='Post Comment'>";
document.getElementById('mylocation').innerHTML=data;
}
</script>
<form name="myForm">
<input type="button" value="comment" onclick="showcommentform()">
<div id="mylocation"></div>
</form>
The innerHTML property can be used to write the
dynamic html on the html document.
33. innerTEXT property :
<script type="text/javascript" >
function validate() {
var msg;
if(document.myForm.userPass.value.length>5){
msg="good";
}
else{
msg="poor";
}
document.getElementById('mylocation').innerText=msg;
}
</script>
<form name="myForm">
<input type="password" value="" name="userPass" onkeyup="validate()">
Strength:<span id="mylocation">no strength</span>
</form>
The innerText property can be used to write the
dynamic text on the html document.
34. JAVASCRIPT HTML DOM - Changing HTML
• The easiest way to modify the content of an HTML element is by using
the innerHTML property.
• Changing the Value of an Attribute :
<p id="p1">Hello World!</p>
<script>
document.getElementById("p1").innerHTML = "New text!";
</script>
<img id="myImage" src="smiley.gif">
<script>
document.getElementById("myImage").src = "landscape.jpg";
</script>
35. JAVASCRIPT HTML DOM - Changing CSS
• To change the style of an HTML element
• The HTML DOM allows you to execute code when an event occurs.
• Events are generated by the browser when :
• An element is clicked on
• The page has loaded
• Input fields are changed
<p id="p2">Hello World!</p>
<script>
document.getElementById("p2").style.color = "blue";
</script>
<h1 id="id1">My Heading 1</h1>
<button type="button"
onclick="document.getElementById('id1').style.c
olor = 'red'">
Click Me!</button>
36. JAVASCRIPT HTML DOM Animation
• All animations should be relative to a container element.
• The container element should be created with style = "position: relative".
• The animation element should be created with style = "position: absolute".
<div id ="container">
<div id ="animate">My animation will go
here</div>
</div>
#container {
width: 400px;
height: 400px;
position: relative;
background: yellow; }
#animate {
width: 50px;
height: 50px;
position: absolute;
background: red;}
JavaScript animations are done by programming gradual changes in an
element's style.
The changes are called by a timer. When the timer interval is small, the
animation looks continuous
function myMove() {.getElementById("animate");
var pos = 0;
var id = setInterval(frame, 5);
function frame() {
if (pos == 350) {
clearInterval(id);
} else {
pos++;
elem.style.top = pos + 'px';
elem.style.left = pos + 'px'; }}}
var elem = document
37. JAVASCRIPT HTML DOM EVENTS
Examples of HTML events:
• When a user clicks the mouse
• When a web page has loaded
• When an image has been loaded
• When the mouse moves over an element
• When an input field is changed
• When an HTML form is submitted
• When a user strokes a key
<!DOCTYPE html>
<html>
<body>
<h1 onclick="changeText(this)">Click on this text!</h1>
<script>
function changeText(id) {
id.innerHTML = "Ooops!";
}
</script>
</body>
</html>
//INVOKES THE EVENTS
38. JAVASCRIPT HTML DOM EVENTS
• HTML Event Attributes: To assign events to HTML elements you can use event attributes.
• HTML DOM allows you to assign events to HTML elements using JavaScript.
• The onload and onunload Events
• The onload event can be used to check the visitor's browser type and browser version, and load
the proper version of the web page based on the information.
• The onchange event is often used in combination with validation of input fields.
<button onclick="displayDate()">Try it</button>
<script>
document.getElementById("myBtn").onclick = displayDate;
</script>
<body onload="checkCookies()">
<input type="text" id="fname" onchange="upperCase()"
39. JavaScript HTML DOM EVENTLISTENER
• The addEventListener() method
• The addEventListener() method attaches an event handler to the specified element.
• The addEventListener() method attaches an event handler to an element without
overwriting existing event handlers.
• The addEventListener() method allows you to add many events to the same element,
without overwriting existing events:
document.getElementById("myBtn").addEventListener("click", displayDate);
element.addEventListener("click", function(){ alert("Hello World!");});
//Add an Event Handler to an Element
element.addEventListener("click", myFunction);
element.addEventListener("click", mySecondFunction);