<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-1955839799848409424</atom:id><lastBuildDate>Sun, 27 Apr 2025 23:04:07 +0000</lastBuildDate><category>How To</category><category>Blogger Tag</category><category>Web Development</category><category>Technology</category><category>Blogger Tips &amp; Tricks</category><category>Css &amp; Jav</category><category>Tutorial</category><category>Guide Ways</category><category>Money Making Secrets</category><category>WordPress</category><category>Make Money Tips</category><category>Millionaire</category><category>Widget</category><category>Html</category><category>Web Programs</category><category>Earn Money Online</category><category>Android</category><category>SEO</category><category>Adsense</category><category>Pc Softwares</category><category>Facebook</category><category>Hosting</category><category>JQUERY</category><category>MISCELLANEOUS</category><category>Social Media Marketing</category><category>Webmaster Tool</category><category>Button</category><category>Downloader</category><category>ASP.NET</category><category>Blockquote</category><category>Comment Box</category><category>Author Profile Box</category><category>GoDaddy</category><category>PayPal</category><category>Paytm</category><category>Tumblr</category><category>404 Error Page</category><category>Ajax</category><category>Angular</category><category>Bootstrap</category><category>Breadcrumbs Navigation</category><category>Digital Marketing</category><category>Django</category><category>Drop Down Menu</category><category>Email</category><category>Firebase</category><category>Fiverr</category><category>Full Width</category><category>Google Translator</category><category>Hover Effects</category><category>Instagram</category><category>MYSQL</category><category>MailChimp</category><category>Niche</category><category>Pc</category><category>Recent Posts Widget</category><category>Search Box</category><category>Surveys</category><category>Twitter</category><category>Udemy</category><category>Vue</category><category>YouTube</category><category>boo</category><category>p</category><title>Post Link Sharing</title><description></description><link>https://plinksharing.blogspot.com/</link><managingEditor>noreply@blogger.com (Arakkha Sênâ)</managingEditor><generator>Blogger</generator><openSearch:totalResults>360</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1955839799848409424.post-1611763951836800710</guid><pubDate>Wed, 24 Feb 2021 07:45:00 +0000</pubDate><atom:updated>2021-02-23T23:45:27.681-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Web Programs</category><category domain="http://www.blogger.com/atom/ns#">WordPress</category><title>WordPress Tutorials</title><description>&lt;div class=&quot;mbtTOC&quot;&gt;
    &lt;button onclick=&quot;mbtToggle()&quot;&gt;Contents&lt;/button&gt;
    &lt;ol id=&quot;mbtTOC&quot;&gt;&lt;/ol&gt;
    &lt;/div&gt;
&lt;h1&gt;Introduction&lt;/h1&gt;
&lt;p&gt;WordPress is an open source&amp;nbsp;&lt;strong&gt;Content Management System (CMS),&lt;/strong&gt;&amp;nbsp;which allows the users to build dynamic websites and blogs. WordPress is the most popular blogging system on the web and allows updating, customizing and managing the website from its back-end CMS and components.&lt;/p&gt;
&lt;h2&gt;What is Content Management System (CMS)?&lt;/h2&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;Content Management System (CMS)&lt;/strong&gt;&amp;nbsp;is a software which stores all the data such as text, photos, music, documents, etc. and is made available on your website. It helps in editing, publishing and modifying the content of the website.&lt;/p&gt;
&lt;p&gt;WordPress was initially released on 27&lt;sup&gt;th&lt;/sup&gt;&amp;nbsp;May, 2003 by Matt Mullenweg and Mike Little. WordPress was announced as open source in October 2009.&lt;/p&gt;
&lt;h2&gt;Features&lt;/h2&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;User Management&lt;/strong&gt;&amp;nbsp;&amp;minus; It allows managing the user information such as changing the role of the users to (subscriber, contributor, author, editor or administrator), create or delete the user, change the password and user information. The main role of the user manager is&amp;nbsp;&lt;strong&gt;Authentication&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Media Management&lt;/strong&gt;&amp;nbsp;&amp;minus; It is the tool for managing the media files and folder, in which you can easily upload, organize and manage the media files on your website.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Theme System&lt;/strong&gt;&amp;nbsp;&amp;minus; It allows modifying the site view and functionality. It includes images, stylesheet, template files and custom pages.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Extend with Plugins&lt;/strong&gt;&amp;nbsp;&amp;minus; Several plugins are available which provides custom functions and features according to the users need.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Search Engine Optimization&lt;/strong&gt;&amp;nbsp;&amp;minus; It provides several search engine optimization (SEO) tools which makes on-site SEO simple.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Multilingual&lt;/strong&gt;&amp;nbsp;&amp;minus; It allows translating the entire content into the language preferred by the user.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Importers&lt;/strong&gt;&amp;nbsp;&amp;minus; It allows importing data in the form of posts. It imports custom files, comments, post pages and tags.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Advantages&lt;/h2&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;It is an open source platform and available for free.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;CSS files can be modified according to the design as per users need.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;There are many plugins and templates available for free. Users can customize the various plugins as per their need.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;It is very easy to edit the content as it uses WYSIWYG editor (What You See Is What You Get is a user interface that allows the user to directly manipulate the layout of document without having a layout command).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Media files can be uploaded easily and quickly.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;It offers several SEO tools which makes on-site SEO simple.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Customization is easy according to the user&#39;s needs.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;It allows creating different roles for users for website such as admin, author, editor and contributor.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Disadvantages&lt;/h2&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;Using several plugins can make the website heavy to load and run.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;PHP knowledge is required to make modifications or changes in the WordPress website.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Sometimes software needs to be updated to keep the WordPress up-to-date with the current browsers and mobile devices. Updating WordPress version leads to loss of data, so a backup copy of the website is required.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Modifying and formatting the graphic images and tables is difficult.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;Installation&lt;/h1&gt;
&lt;h2&gt;System Requirements for WordPress&lt;/h2&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Database&lt;/strong&gt;&amp;nbsp;&amp;minus; MySQL 5.0 +&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Web Server&lt;/strong&gt;&amp;nbsp;&amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;WAMP (Windows)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;LAMP (Linux)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;XAMP (Multi-platform)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;MAMP (Macintosh)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Operating System&lt;/strong&gt;&amp;nbsp;&amp;minus; Cross-platform&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Browser Support&lt;/strong&gt;&amp;nbsp;&amp;minus; IE (Internet Explorer 8+), Firefox, Google chrome, Safari, Opera&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;PHP Compatibility&lt;/strong&gt;&amp;nbsp;&amp;minus; PHP 5.2+&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Download WordPress&lt;/h2&gt;
&lt;p&gt;When you open the link&amp;nbsp;&lt;a href=&quot;https://wordpress.org/download/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://wordpress.org/download/&lt;/a&gt;, you will get to see a screen as the following snapshot &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-installation/wordpress-installation.jpg&quot; alt=&quot;WordPress Installation&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Create Store Database&lt;/h2&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;WordPress requires MySQL database. So create a new empty database with user/password (for example, user as &quot;root&quot; and password as &quot;root&quot; or else you can set as per your convenience).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Then, you can continue with the installation process as discussed further.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Set Up Wizard&lt;/h2&gt;
&lt;p&gt;It&#39;s very easy to set up WordPress into your system. The following steps describe how to set up WordPress locally on your system.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (1)&lt;/strong&gt;&amp;nbsp;&amp;minus; Extract the downloaded WordPress folder and upload it into your web server or localhost.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (2)&lt;/strong&gt;&amp;nbsp;&amp;minus; Open your browser and navigate to your WordPress file path, then you will get the first screen of the WordPress installer as shown in the following screen. In our case, the path is&amp;nbsp;&lt;strong&gt;localhost/&amp;lt; Your_wordpress_folder &amp;gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-installation/wordpress-installation-step1.jpg&quot; alt=&quot;WordPress Installation&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Select your language for the WordPress and click on&amp;nbsp;&lt;strong&gt;Continue&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (3)&lt;/strong&gt;&amp;nbsp;&amp;minus; In this step, you can view the information needed for the database before proceeding with WordPress installation.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-installation/wordpress-installation-step2.jpg&quot; alt=&quot;WordPress Installation&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Click on&amp;nbsp;&lt;strong&gt;Let&#39;s go!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (4)&lt;/strong&gt;&amp;nbsp;&amp;minus; Here, you have to enter the information about the MySQL database as described in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-installation/wordpress-installation-step3.jpg&quot; alt=&quot;WordPress Installation&quot; /&gt;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Database Name&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter the database name which you have created in MySQL database for WordPress.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Username&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter the user name of your MySQL database.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Password&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter the password which you had set for MySQL database.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Database Host&lt;/strong&gt;&amp;nbsp;&amp;minus; Write the host name, by default it will be localhost.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Table Prefix&lt;/strong&gt;&amp;nbsp;&amp;minus; It is used to add prefix in the database tables which helps to run multiple sites on the same database. It takes the default value.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After filling all information, click on&amp;nbsp;&lt;strong&gt;Submit&lt;/strong&gt;&amp;nbsp;button.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (5)&lt;/strong&gt;&amp;nbsp;&amp;minus; WordPress checks the database setting and gives you the confirmation screen as shown in the following snapshot.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-installation/wordpress-installation-step4.jpg&quot; alt=&quot;WordPress Installation&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Click on&amp;nbsp;&lt;strong&gt;Run the install&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (6)&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter administrative information.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-installation/wordpress-installation-step5.jpg&quot; alt=&quot;WordPress Installation&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It contains the following fields &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Site Title&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter the name of the site which you are going to create in WordPress.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Username&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter the username as per your choice while logging in the WordPress.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Password twice&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter password two times to protect your site.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Your E-mail&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter your e-mail address which helps to recover the password or any update.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Privacy&lt;/strong&gt;&amp;nbsp;&amp;minus; It allows the search engine to index this site after checking the checkbox.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After filling all the information, click on the&amp;nbsp;&lt;strong&gt;Install WordPress&lt;/strong&gt;&amp;nbsp;button.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (7)&lt;/strong&gt;&amp;nbsp;&amp;minus; After installation being successful, you will get a screen of the stating success as seen in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-installation/wordpress-installation-step6.jpg&quot; alt=&quot;WordPress Installation&quot; /&gt;&lt;/p&gt;
&lt;p&gt;You can view your username and password detail added in WordPress.&lt;/p&gt;
&lt;p&gt;Click on&amp;nbsp;&lt;strong&gt;Log In&lt;/strong&gt;&amp;nbsp;button.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (8)&lt;/strong&gt;&amp;nbsp;&amp;minus; After clicking on login, you will get a WordPress Admin Panel as depicted in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-installation/wordpress-installation-step7.jpg&quot; alt=&quot;WordPress Installation&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Enter the username and password which you had mentioned during installation as shown in step 6 and click on the&amp;nbsp;&lt;strong&gt;Log In&lt;/strong&gt;&amp;nbsp;button.&lt;/p&gt;

&lt;h1&gt;Dasboard&lt;/h1&gt;
&lt;p&gt;The WordPress Dashboard is a first screen which will be seen when you log into the administration area of your blog which will display the overview of the website. It is a collection of gadgets that provide information and provide an overview of what&#39;s happening with your blog. You can customize your needs by using some quick links such as writing quick draft, replying to latest comment, etc.&lt;/p&gt;
&lt;p&gt;Dashboard can be categorized as shown in the following snapshot. Each of these categories are discussed in the following sections &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-dashboard/wordpress-dashboard.jpg&quot; alt=&quot;Wordpress Dashboard&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Dashboard Menu&lt;/h2&gt;
&lt;p&gt;The WordPress Dashboard provides navigation menu that contains some menu options such as posts, media library, pages, comments, appearance options, plugins, users, tools and settings on the left side.&lt;/p&gt;
&lt;h2&gt;Screen Options&lt;/h2&gt;
&lt;p&gt;The dashboard contains different types of widgets which can be shown or hidden on some screens. It contains check boxes to show or hide screen options and also allows us to customize sections on the admin screen.&lt;/p&gt;
&lt;h2&gt;Welcome&lt;/h2&gt;
&lt;p&gt;It includes the&amp;nbsp;&lt;strong&gt;Customize Your Site&lt;/strong&gt;&amp;nbsp;button which allows customizing your WordPress theme. The center column provides some of the useful links such as creating a blog post, creating a page and view the front end of your website. Last column contains links to widgets, menus, settings related to comments and also a link to the&amp;nbsp;&lt;strong&gt;First Steps With WordPress&lt;/strong&gt;&amp;nbsp;page in the WordPress codex.&lt;/p&gt;
&lt;h2&gt;Quick Draft&lt;/h2&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;Quick Draft&lt;/strong&gt;&amp;nbsp;is a mini post editor which allows writing, saving and publishing a post from admin dashboard. It includes the title for the draft, some notes about the draft and save it as a Draft.&lt;/p&gt;
&lt;h2&gt;WordPress News&lt;/h2&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;WordPress News&lt;/strong&gt;&amp;nbsp;widget displays the latest news such as latest software version, updates, alerts, news regarding the software etc. from the official WordPress blog.&lt;/p&gt;
&lt;h2&gt;Activity&lt;/h2&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;Activity&lt;/strong&gt;&amp;nbsp;widget includes latest comments on your blog, recent posts and recently published posts. It allows you to approve, disapprove, reply, edit, or delete a comment. It also allows you to move a comment to spam.&lt;/p&gt;
&lt;h2&gt;At a Glance&lt;/h2&gt;
&lt;p&gt;This section gives an overview of your blog&#39;s posts, number of published posts and pages, and number of comments. When you click on these links, you will be taken to the respective screen. It displays the current version of running WordPress along with the currently running theme on the site.&lt;/p&gt;

&lt;h1&gt;General Setting&lt;/h1&gt;
&lt;p&gt;In this chapter, we will study about&amp;nbsp;&lt;strong&gt;General Settings&lt;/strong&gt;&amp;nbsp;in WordPress. WordPress general setting is used to set the basic configuration settings for your site. In the setting administration screen, it is a default setting screen.&lt;/p&gt;
&lt;p&gt;Following are the steps to access the general settings &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Settings &amp;rarr; General&lt;/strong&gt;&amp;nbsp;option in WordPress.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-general-setting/wordpress-general-setting-step1.jpg&quot; alt=&quot;WordPress General Setting&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt;&amp;nbsp;&amp;minus; The General Setting page is displayed as shown in the following snapshot.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-general-setting/wordpress-general-setting-step2.jpg&quot; alt=&quot;WordPress General Setting&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Following are the details of the fields on general settings page.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Site Title&lt;/strong&gt;&amp;nbsp;&amp;minus; It displays the name of the site in the template header.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Tagline&lt;/strong&gt;&amp;nbsp;&amp;minus; Displays a short sentence about your site.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;WordPress Address (URL)&lt;/strong&gt;&amp;nbsp;&amp;minus; It is the URL of WordPress directory where your all core application files are present.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Site Address(URL)&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter the site URL which you want your site to display on the browser.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;E-mail Address&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter your e-mail address which helps to recover your password or any update.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Membership&lt;/strong&gt;&amp;nbsp;&amp;minus; Anyone can register an account on your site after you check this checkbox.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;New User Default Role&lt;/strong&gt;&amp;nbsp;&amp;minus; The default role is set for the newly registered user or members.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Timezone&lt;/strong&gt;&amp;nbsp;&amp;minus; Sets the time zone based on the particular city.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Date Format&lt;/strong&gt;&amp;nbsp;&amp;minus; Sets the date format as you need to display on the site.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Time Format&lt;/strong&gt;&amp;nbsp;&amp;minus; Sets the time format as you need to display on the site.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Week Starts On&lt;/strong&gt;&amp;nbsp;&amp;minus; Select the week day which you prefer to start for WordPress calendar. By default it is set as Monday.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Site Language&lt;/strong&gt;&amp;nbsp;&amp;minus; Sets the language for the WordPress dashboard.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Step3&lt;/strong&gt;&amp;nbsp;&amp;minus; After filling all the information about general settings, click on&amp;nbsp;&lt;strong&gt;Save Changes&lt;/strong&gt;button. It saves all your general setting information.&lt;/p&gt;

&lt;h1&gt;Writing Setting&lt;/h1&gt;
&lt;p&gt;The writing settings controls the writing experience and provides options for customizing WordPress site. These settings control the features in the adding and editing posts, Pages, and Post Types, as well as the optional functions like Remote Publishing, Post via e-mail, and Update Services.&lt;/p&gt;
&lt;p&gt;Following are the steps to access the writing settings &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (1)&lt;/strong&gt;&amp;nbsp;&amp;minus; To change writing settings, go to&amp;nbsp;&lt;strong&gt;Settings &amp;rarr; Writing&lt;/strong&gt;&amp;nbsp;option.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-writing-settings/wordpress-writing-setting-step1.jpg&quot; alt=&quot;WordPress Writing Setting&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (2)&lt;/strong&gt;&amp;nbsp;&amp;minus; The Writing Setting page is displayed as shown in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-writing-settings/wordpress-writing-setting-step2.jpg&quot; alt=&quot;WordPress Writing Setting&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Following are the details of the fields on the page.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Formatting&lt;/strong&gt;&amp;nbsp;&amp;minus; This field defines two sub options for better user experience.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;The first option&amp;nbsp;&lt;em&gt;Convert emoticons like :-) and :-P to graphics on display&lt;/em&gt;will turn text-based emoticons into graphic-based emoticons.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The second option&amp;nbsp;&lt;em&gt;WordPress should correct invalidly nested XHTML automatically&lt;/em&gt;&amp;nbsp;corrects the invalid XHTML placed within the posts or pages.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Default Post Category&lt;/strong&gt;&amp;nbsp;&amp;minus; It is a category to be applied to a post and you can leave it as&amp;nbsp;&lt;em&gt;Uncategorized&lt;/em&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Default Post Format&lt;/strong&gt;&amp;nbsp;&amp;minus; It is used by themes to select post format to be applied to a post or create different styles for different types of posts.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Post via e-mail&lt;/strong&gt;&amp;nbsp;&amp;minus; This option uses e-mail address to create posts and publishes posts on your blog through e-mail. To use this, you&#39;ll need to set up a secret e-mail account with a POP3 access, and any mail received at this address will be posted.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Mail Server&lt;/strong&gt;&amp;nbsp;&amp;minus; It allows reading the e-mails that you send to WordPress and stores them for retrieval. For this, you need to have POP3 compatible mail server and it will have URI address such as mail.example.com, which you should enter here.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Login Name&lt;/strong&gt;&amp;nbsp;&amp;minus; To create posts, WordPress will need its own e-mail account. The&amp;nbsp;&lt;strong&gt;Login Name&lt;/strong&gt;&amp;nbsp;will use this e-mail address and should be kept as a secret as spammers will post links redirecting to their own websites.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Password&lt;/strong&gt;&amp;nbsp;&amp;minus; Set password for the above e-mail address.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Default Mail Category&lt;/strong&gt;&amp;nbsp;&amp;minus; It allows selecting custom category for all the posts that are published via Post by e-mail feature.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Update Services&lt;/strong&gt;&amp;nbsp;&amp;minus; When you publish a new post, WordPress will automatically notify the site update services in the box. See the&amp;nbsp;&lt;strong&gt;Update Services&lt;/strong&gt;&amp;nbsp;on the codex for the long list of possible services.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Step (3)&lt;/strong&gt;&amp;nbsp;&amp;minus; After filling all the above information, click on&amp;nbsp;&lt;strong&gt;Save Changes&lt;/strong&gt;&amp;nbsp;button to save your information.&lt;/p&gt;

&lt;h1&gt;Reading Setting&lt;/h1&gt;
&lt;p&gt;In this chapter, we will study about&amp;nbsp;&lt;strong&gt;Reading Settings&lt;/strong&gt;&amp;nbsp;in WordPress. Reading Setting is used to set the content related to the front page. You can set the number of post to be displayed on the main page.&lt;/p&gt;
&lt;p&gt;Following are the steps to access the reading settings &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (1)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Settings &amp;rarr; Reading&lt;/strong&gt;&amp;nbsp;option in WordPress.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-reading-settings/wordpress-reading-settings-step1.jpg&quot; alt=&quot;WordPress Reading Setting&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step(2)&lt;/strong&gt;&amp;nbsp;&amp;minus; The Reading Settings page is displayed as shown in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-reading-settings/wordpress-reading-settings-step2.jpg&quot; alt=&quot;WordPress Reading Setting&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Following are the details of the fields on reading settings.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Front page displays&lt;/strong&gt;&amp;nbsp;&amp;minus; This section is used to display the front page in any of the following format &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Your latest posts&lt;/strong&gt;&amp;nbsp;&amp;minus; It displays latest posts on the front page.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;A static page&lt;/strong&gt;&amp;nbsp;&amp;minus; It displays the static pages on the front page.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Front Page&lt;/strong&gt;&amp;nbsp;&amp;minus; You can select the actual page you want to display on front page from the drop down.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Posts Page&lt;/strong&gt;&amp;nbsp;&amp;minus; You can select the page from the drop down which contains posts.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Blog pages show at most&lt;/strong&gt;&amp;nbsp;&amp;minus; The number of posts to be displayed per page or site. By default, it is set as 10.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Syndication feeds show the most recent&lt;/strong&gt;&amp;nbsp;&amp;minus; The user can view the number of posts when they download one of the site feeds. By default, it is set as 10.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;For each article in a feed, show&lt;/strong&gt;&amp;nbsp;&amp;minus; This section is used to display the post by selecting any of the following formats &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Full Text&lt;/strong&gt;&amp;nbsp;&amp;minus; It displays the complete post. It is set as default.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;&amp;nbsp;&amp;minus; It displays the summary of the post.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Search Engine Visibility&lt;/strong&gt;&amp;nbsp;&amp;minus; After clicking on the checkbox,&amp;nbsp;&lt;em&gt;Discourage search engines from indexing this site&lt;/em&gt;, your site will be ignored by the search engine.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Step(3)&lt;/strong&gt;&amp;nbsp;&amp;minus; After filling all the information, click on&amp;nbsp;&lt;strong&gt;Save Changes&lt;/strong&gt;&amp;nbsp;button to save your Reading Setting information.&lt;/p&gt;

&lt;h1&gt;Discussing Setting&lt;/h1&gt;
&lt;p&gt;In this chapter, we will study about&amp;nbsp;&lt;strong&gt;Discussion settings&lt;/strong&gt;&amp;nbsp;in WordPress. WordPress discussion setting can be defined as the interaction between the blogger and the visitors. These settings are done by the admin to have a control over the posts/pages that come in through users.&lt;/p&gt;
&lt;p&gt;Following are the steps to access the Discussion setting &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (1)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Settings &amp;rarr; Discussion&lt;/strong&gt;&amp;nbsp;option in WordPress.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-discussion-settings/wordpress-discussion-settings-step1.jpg&quot; alt=&quot;WordPress Discussion Setting&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (2)&lt;/strong&gt;&amp;nbsp;&amp;minus; The Discussion Settings page is displayed as shown in the following snapshot.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-discussion-settings/wordpress-discussion-settings-step2.jpg&quot; alt=&quot;WordPress Discussion Setting&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Following fields are seen in Discussion settings.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Default article settings&lt;/strong&gt;&amp;nbsp;&amp;minus; These settings are default to the new pages you create or new posts. This contains three more settings. They are &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Attempt to notify any blogs linked to from the article&lt;/strong&gt;&amp;nbsp;&amp;minus; When you publish articles then it sends a notification (sends pings and trackback) to other blogs.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Allow link notifications from other blogs (pingbacks and trackbacks)&lt;/strong&gt;&amp;nbsp;&amp;minus; Accepts pings from other blogs.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Allow people to post comments on new articles&lt;/strong&gt;&amp;nbsp;&amp;minus; You can allow or disallow other people to comment on your article using this setting.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can change the settings as per your will for individual articles.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Other Comment Settings&lt;/strong&gt;&amp;nbsp;&amp;minus; This setting has the following options &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Comment author must fill out name and e-mail&lt;/strong&gt;&amp;nbsp;&amp;minus; When you check this box, it is mandatory for visitors to fill their name and email address.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Users must be registered and logged in to comment&lt;/strong&gt;&amp;nbsp;&amp;minus; If you check this box, only those registered visitors can leave comments, if not checked anyone can leave any number of comments.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Automatically close comments on articles older than days&lt;/strong&gt;&amp;nbsp;&amp;minus; This option allows you to accept comments only for a particular time period as per your wish.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Enable threaded (nested) comments&lt;/strong&gt;&amp;nbsp;&amp;minus; When you check this option, visitors can reply or have a discussion and get responses.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Break comments into pages with top level comments per page and the page displayed by default&lt;/strong&gt;&amp;nbsp;&amp;minus; If your pages are getting a lot of comments then you can split them into different pages by checking this box.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Comments should be displayed with the comments at the top of each page&lt;/strong&gt;&amp;nbsp;&amp;minus; You can arrange the comments in the form of ascending or descending order.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Email me whenever&lt;/strong&gt;&amp;nbsp;&amp;minus; This setting contains two options, namely &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Anyone posts a comment&lt;/strong&gt;&amp;nbsp;&amp;minus; When you check into this box, the author gets an e-mail for every single comment that is posted.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;A comment is held for moderation&lt;/strong&gt;&amp;nbsp;&amp;minus; This is used in case you do not want your comment to be updated before it&#39;s moderated by the admin.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Before a comment appears&lt;/strong&gt;&amp;nbsp;&amp;minus; This setting allows how your posts are controlled. There are two more settings as followed &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Comment must be manually approved&lt;/strong&gt;&amp;nbsp;&amp;minus; If you check this box then only the approved comments by the admin can be displayed on the posts or pages.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Comment author must have a previously approved comment&lt;/strong&gt;&amp;nbsp;&amp;minus; This can be checked when you want to approve a comment of an author whose has commented and his e-mail address matches the e-mail address of the previous posted comment. Otherwise the comment is held for moderation.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Comment Moderation&lt;/strong&gt;&amp;nbsp;&amp;minus; Contain only a specific number of links that are allowed into a comment.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Comment Blacklist&lt;/strong&gt;&amp;nbsp;&amp;minus; You can input your own spam words which you do not want your visitors to enter into the comments, URL, e-mail etc.; later it would filter the comments.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Avatars&lt;/strong&gt;&amp;nbsp;&amp;minus; Avatar is a small image that displays at the top-right-hand corner of the dashboard screen beside your name. It is like your profile picture. Here you have a few more options where you can set your avatar for WordPress site.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Avatar Display&lt;/strong&gt;&amp;nbsp;&amp;minus; It displays your avatar besides your name when it is checked.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Maximum rating&lt;/strong&gt;&amp;nbsp;&amp;minus; You have a four other options of avatars you can use. They are G, PG, R and X. This is the age section where you select according to which type of audience you want to display your posts.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Default Avatar&lt;/strong&gt;&amp;nbsp;&amp;minus; In this option, there are few more types of avatars with images; you can keep these avatars according to your visitors e-mail address.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Step (3)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Save Changes&lt;/strong&gt;&amp;nbsp;button to save the changes.&lt;/p&gt;

&lt;h1&gt;Media Setting&lt;/h1&gt;
&lt;p&gt;In this chapter, we will study about&amp;nbsp;&lt;strong&gt;Media Settings&lt;/strong&gt;&amp;nbsp;in WordPress. It is used to set the height and width of the images which you&#39;re going to use on your website.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (1)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Settings &amp;rarr; Media&lt;/strong&gt;&amp;nbsp;option in WordPress.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-media-settings/wordpress-media-settings-step1.jpg&quot; alt=&quot;Wordpress Media Setting&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (2)&lt;/strong&gt;&amp;nbsp;&amp;minus; The Media Settings page is displayed as seen in the following screenshot.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-media-settings/wordpress-media-settings-step2.jpg&quot; alt=&quot;Wordpress Media Setting&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Following are the details of the fields on Media settings &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Thumbnail size&lt;/strong&gt;&amp;nbsp;&amp;minus; Set the size of the thumbnail.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Medium size&lt;/strong&gt;&amp;nbsp;&amp;minus; Set the height and width of medium size images.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Large size&lt;/strong&gt;&amp;nbsp;&amp;minus; Set width and height of larger images.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Uploading files&lt;/strong&gt;&amp;nbsp;&amp;minus; After checking this checkbox, the uploaded image will be arranged into year and month based folder.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Step (3)&lt;/strong&gt;&amp;nbsp;&amp;minus; After setting the dimension in pixels, click on&amp;nbsp;&lt;strong&gt;Save Changes&lt;/strong&gt;&amp;nbsp;button. It saves your media setting information.&lt;/p&gt;

&lt;h1&gt;Add Category&lt;/h1&gt;
&lt;p&gt;In this chapter, we will study about how to&amp;nbsp;&lt;strong&gt;Add Categories&lt;/strong&gt;&amp;nbsp;in WordPress. Category is used to indicate sections of your site and group related posts. It sorts the group content into different sections. It is a very convenient way to organize the posts.&lt;/p&gt;
&lt;p&gt;To access the Category section, follows the mentioned steps &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (1)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Posts &amp;rarr; Categories&lt;/strong&gt;&amp;nbsp;option in WordPress.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-category/wordpress-add-category-step1.jpg&quot; alt=&quot;WordPress add category&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (2)&lt;/strong&gt;&amp;nbsp;&amp;minus; The&amp;nbsp;&lt;strong&gt;Categories&lt;/strong&gt;&amp;nbsp;page is displayed as shown in the following screenshot.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-category/wordpress-add-category-step2.jpg&quot; alt=&quot;WordPress add category&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Following are the details of the fields on Categories.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Name&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter the unique name of categories.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Slug&lt;/strong&gt;&amp;nbsp;&amp;minus; A word chosen to describe your post. It is specified in the tags URL.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Parent&lt;/strong&gt;&amp;nbsp;&amp;minus; By selecting the parent category from dropdown, you can set the particular category as sub-category or can keep it as None.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;&amp;nbsp;&amp;minus; Add brief description of your category. It is optional.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Step (3)&lt;/strong&gt;&amp;nbsp;&amp;minus; After filling all the information about Categories, click on&amp;nbsp;&lt;strong&gt;Add New Category&lt;/strong&gt;button.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (4)&lt;/strong&gt;&amp;nbsp;&amp;minus; After clicking on&amp;nbsp;&lt;strong&gt;Add New Category&lt;/strong&gt;, the new created category will get displayed on the right side of the page as shown in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-category/wordpress-add-category-step3.jpg&quot; alt=&quot;WordPress add category&quot; /&gt;&lt;/p&gt;

&lt;h1&gt;Edit Category&lt;/h1&gt;
&lt;p&gt;In this chapter, we will study the simple steps to&amp;nbsp;&lt;strong&gt;Edit Categories&lt;/strong&gt;&amp;nbsp;in WordPress.&lt;/p&gt;
&lt;p&gt;Following are the simple steps to edit categories in WordPress.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (1)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Posts &amp;rarr; Categories&lt;/strong&gt;&amp;nbsp;in WordPress.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-edit-category/wordpress-edit-category-step1.jpg&quot; alt=&quot;WordPress Edit Category&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (2)&lt;/strong&gt;&amp;nbsp;&amp;minus; You can view Category1 (Category1 was created in the chapter&amp;nbsp;&lt;a href=&quot;https://www.tutorialspoint.com/wordpress/wordpress_add_category.htm&quot;&gt;WordPress - Add Category&lt;/a&gt;). When the cursor hovers on the Categories, then a few options get displayed below the Category name. There are two ways to edit the categories i.e.&amp;nbsp;&lt;strong&gt;Edit&lt;/strong&gt;and&amp;nbsp;&lt;strong&gt;Quick Edit&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Edit&lt;/strong&gt;&amp;nbsp;option in Categories section as seen in the following screenshot.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-edit-category/wordpress-edit-category-step2.jpg&quot; alt=&quot;WordPress Edit Category&quot; /&gt;&lt;/p&gt;
&lt;p&gt;You can edit any of the required field, and then click&amp;nbsp;&lt;strong&gt;Update&lt;/strong&gt;&amp;nbsp;button as shown in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-edit-category/wordpress-edit-category-step3.jpg&quot; alt=&quot;WordPress Edit Category&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Category fields are same from the chapter&amp;nbsp;&lt;a href=&quot;https://www.tutorialspoint.com/wordpress/wordpress_add_category.htm&quot;&gt;WordPress - Add Category&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Quick Edit&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Quick Edit&lt;/strong&gt;&amp;nbsp;option in Categories section as shown in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-edit-category/wordpress-edit-category-step4.jpg&quot; alt=&quot;WordPress Edit Category&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here, you can only edit the Name and Slug of the category as seen in the following screen and then finally click on&amp;nbsp;&lt;strong&gt;Update Category&lt;/strong&gt;&amp;nbsp;button.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-edit-category/wordpress-edit-category-step5.jpg&quot; alt=&quot;WordPress Edit Category&quot; /&gt;&lt;/p&gt;

&lt;h1&gt;Delete Category&lt;/h1&gt;
&lt;p&gt;In this chapter, we will study about how to&amp;nbsp;&lt;strong&gt;Delete Categories&lt;/strong&gt;&amp;nbsp;in WordPress.&lt;/p&gt;
&lt;p&gt;Following are the simple steps to delete categories in WordPress.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (1)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Posts &amp;rarr; Categories&lt;/strong&gt;&amp;nbsp;in WordPress.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-delete-category/wordpress-delete-category-step1.jpg&quot; alt=&quot;WordPress delete category&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (2)&lt;/strong&gt;&amp;nbsp;&amp;minus; You can delete Category1 (Category1 was created in the chapter&amp;nbsp;&lt;a href=&quot;https://www.tutorialspoint.com/wordpress/wordpress_add_category.htm&quot;&gt;Wordpress - Add Category&lt;/a&gt;). When the cursor hovers on the Categories, a few options get displayed below the Category name. Click on&amp;nbsp;&lt;strong&gt;Delete&lt;/strong&gt;&amp;nbsp;button as shown in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-delete-category/wordpress-delete-category-step2.jpg&quot; alt=&quot;WordPress delete category&quot; /&gt;&lt;/p&gt;
&lt;p&gt;When you click on delete, you will get a pop message asking for confirmation to delete the particular category as shown in the following screenshot.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-delete-category/wordpress-delete-category-step3.jpg&quot; alt=&quot;WordPress delete category&quot; /&gt;&lt;/p&gt;

&lt;h1&gt;Add Posts&lt;/h1&gt;
&lt;p&gt;In this chapter, we will study how to&amp;nbsp;&lt;strong&gt;Add Posts&lt;/strong&gt;&amp;nbsp;in WordPress. Posts are also known as&amp;nbsp;&lt;em&gt;articles&lt;/em&gt;&amp;nbsp;and sometimes referred as blogs or blog posts. These are used to popularize your blogs.&lt;/p&gt;
&lt;p&gt;Following are the simple steps to Add Posts in WordPress.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (1)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Posts &amp;rarr; Add New&lt;/strong&gt;&amp;nbsp;in WordPress.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-posts/wordpress-add-posts-step1.jpg&quot; alt=&quot;WordPress Add Posts&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (2)&lt;/strong&gt;&amp;nbsp;&amp;minus; You will get the editor page of the Post as shown in the following screen. You can use the WordPress WYSIWYG editor to add the actual content of your post. We will study in detail about WYSIWYG editor in the chapter&amp;nbsp;&lt;a href=&quot;https://www.tutorialspoint.com/wordpress/wordpress_add_pages.htm&quot;&gt;WordPress - Add Pages&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-posts/wordpress-add-posts-step2.jpg&quot; alt=&quot;WordPress Add Posts&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Following are the fields on the editor page of the Add Posts Page.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Post Title&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter the title of the post, i.e.,&amp;nbsp;&lt;strong&gt;Post1&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Post Content&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter the content of your post.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Step (3)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Publish&lt;/strong&gt;&amp;nbsp;button to publish your respective post.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-posts/wordpress-add-posts-step3.jpg&quot; alt=&quot;Wordpress Add Posts&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Following are the few other options present in the Publish section.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Save Draft&lt;/strong&gt;&amp;nbsp;&amp;minus; It saves the post as a draft.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Preview&lt;/strong&gt;&amp;nbsp;&amp;minus; You can preview your post before publishing.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Move to Trash&lt;/strong&gt;&amp;nbsp;&amp;minus; Deletes the post.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Status&lt;/strong&gt;&amp;nbsp;&amp;minus; Change the status of your post to&amp;nbsp;&lt;em&gt;Published, Pending,&lt;/em&gt;&amp;nbsp;or&amp;nbsp;&lt;em&gt;Reviewer Draft&lt;/em&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Visibility&lt;/strong&gt;&amp;nbsp;&amp;minus; Change the visibility of the post to&amp;nbsp;&lt;em&gt;Public, Private&lt;/em&gt;&amp;nbsp;or&amp;nbsp;&lt;em&gt;Password protected&lt;/em&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Published&lt;/strong&gt;&amp;nbsp;&amp;minus; Change the publishded post date and time.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;Edit Posts&lt;/h1&gt;
&lt;p&gt;In this chapter, we will study how to&amp;nbsp;&lt;strong&gt;Edit Posts&lt;/strong&gt;&amp;nbsp;on WordPress.&lt;/p&gt;
&lt;p&gt;Following are the simple steps to Edit Posts in WordPress.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (1)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Posts &amp;rarr; All Posts&lt;/strong&gt;&amp;nbsp;in WordPress.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-edit-posts/wordpress-edit-posts-step1.jpg&quot; alt=&quot;WordPress Edit Posts&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (2)&lt;/strong&gt;&amp;nbsp;&amp;minus; You can view Post1 (Post1 was created in the chapter&amp;nbsp;&lt;a href=&quot;https://www.tutorialspoint.com/wordpress/wordpress_add_posts.htm&quot;&gt;WordPress - Add Posts&lt;/a&gt;). When the cursor hovers on the Post, few options get displayed below the Post name. There are two ways to edit the Post i.e.&amp;nbsp;&lt;strong&gt;Edit&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;Quick Edit&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Edit&lt;/strong&gt;&amp;nbsp;option in Post1 as shown in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-edit-posts/wordpress-edit-posts-step2.jpg&quot; alt=&quot;WordPress Edit Posts&quot; /&gt;&lt;/p&gt;
&lt;p&gt;You can edit or change the content or title of the post as per your needs, and then click on&amp;nbsp;&lt;strong&gt;Update&lt;/strong&gt;&amp;nbsp;button as shown in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-edit-posts/wordpress-edit-posts-step3.jpg&quot; alt=&quot;WordPress Edit Posts&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Quick Edit&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Quick Edit&lt;/strong&gt;&amp;nbsp;option in Post1 as shown in the following screenshot.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-edit-posts/wordpress-edit-posts-step4.jpg&quot; alt=&quot;WordPress Edit Posts&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here you can edit the&amp;nbsp;&lt;strong&gt;Title, Slug&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;date&lt;/strong&gt;&amp;nbsp;of the posts and can also select the categories for your post as shown in the following screenshot and then click on&amp;nbsp;&lt;strong&gt;Update&lt;/strong&gt;&amp;nbsp;button to confirm post edits.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-edit-posts/wordpress-edit-posts-step5.jpg&quot; alt=&quot;WordPress Edit Posts&quot; /&gt;&lt;/p&gt;

&lt;h1&gt;Delete Posts&lt;/h1&gt;
&lt;p&gt;In this chapter, we will study how to&amp;nbsp;&lt;strong&gt;Delete Posts&lt;/strong&gt;&amp;nbsp;in WordPress.&lt;/p&gt;
&lt;p&gt;Following are the steps to&amp;nbsp;&lt;strong&gt;Delete Posts&lt;/strong&gt;&amp;nbsp;in WordPress.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (1)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Posts &amp;rarr; All Post&lt;/strong&gt;&amp;nbsp;in WordPress.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-delete-posts/wordpress-delete-posts-step1.jpg&quot; alt=&quot;WordPress delete posts&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (2)&lt;/strong&gt;&amp;nbsp;&amp;minus; You can delete Post1 (Post1 was created in the chapter&amp;nbsp;&lt;a href=&quot;https://www.tutorialspoint.com/wordpress/wordpress_add_posts.htm&quot;&gt;Wordpress - Add Posts&lt;/a&gt;). When the cursor hovers on the Post, then a few options get displayed below Post1. Click on&amp;nbsp;&lt;strong&gt;Trash&lt;/strong&gt;&amp;nbsp;option to delete the post.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-delete-posts/wordpress-delete-posts-step2.jpg&quot; alt=&quot;WordPress delete posts&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (3)&lt;/strong&gt;&amp;nbsp;&amp;minus; You can view your post lists to confirm if the above post is deleted.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-delete-posts/wordpress-delete-posts-step3.jpg&quot; alt=&quot;WordPress delete posts&quot; /&gt;&lt;/p&gt;

&lt;h1&gt;Media Library&lt;/h1&gt;
&lt;p&gt;In this chapter, we will learn about&amp;nbsp;&lt;strong&gt;Media Library&lt;/strong&gt;&amp;nbsp;in WordPress.&amp;nbsp;&lt;strong&gt;Media Library&lt;/strong&gt;&amp;nbsp;consists of the images, audios, videos and files that you can upload and add to the content when writing a Post or Page. Here you can view, add, edit or delete any media related objects if not needed.&lt;/p&gt;
&lt;p&gt;Following are the steps to understand about&amp;nbsp;&lt;strong&gt;Media Library&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (1)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Media &amp;rarr; Library&lt;/strong&gt;&amp;nbsp;in WordPress.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-media-library/wordpress-media-library-step1.jpg&quot; alt=&quot;WordPress Media Library&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (2)&lt;/strong&gt;&amp;nbsp;&amp;minus; You can view media files like images, audios, videos. Click on&amp;nbsp;&lt;strong&gt;Add Media&lt;/strong&gt;button.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-media-library/wordpress-media-library-step2.jpg&quot; alt=&quot;WordPress Media Library&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (3)&lt;/strong&gt;&amp;nbsp;&amp;minus; The&amp;nbsp;&lt;em&gt;Upload New Media&lt;/em&gt;&amp;nbsp;page gets displayed. You can learn how to Add Media in the next chapter.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-media-library/wordpress-media-library-step3.jpg&quot; alt=&quot;WordPress Media Library&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (4)&lt;/strong&gt;&amp;nbsp;&amp;minus; You can view a bar as shown in the following screenshot.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-media-library/wordpress-media-library-step4.jpg&quot; alt=&quot;WordPress Media Library&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The various tabs that appear have the following functions &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;List View&lt;/strong&gt;&amp;nbsp;&amp;minus; Displays the images and videos in list form.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-media-library/wordpress-media-library-step6.jpg&quot; alt=&quot;WordPress Media Library&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Grid View&lt;/strong&gt;&amp;nbsp;&amp;minus; Displays all images in the grid format as shown in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-media-library/wordpress-media-library-step5.jpg&quot; alt=&quot;WordPress Media Library&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Filter the images and videos&lt;/strong&gt;&amp;nbsp;&amp;minus; Filters the images and videos.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Search Box&lt;/strong&gt;&amp;nbsp;&amp;minus; Helps to search a particular image by inserting the name into the box.&lt;/p&gt;

&lt;h1&gt;Add Media&lt;/h1&gt;
&lt;p&gt;In this chapter, we will study how to&amp;nbsp;&lt;strong&gt;Add Media files&lt;/strong&gt;&amp;nbsp;in WordPress. WordPress allows you to add, all kind of media files like videos, audios and images.&lt;/p&gt;
&lt;p&gt;Following are the steps to&amp;nbsp;&lt;strong&gt;Add Media&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (1)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Media &amp;rarr; Add New&lt;/strong&gt;&amp;nbsp;in WordPress.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-media/wordpress-add-media-step1.jpg&quot; alt=&quot;WordPress Add Media&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (2)&lt;/strong&gt;&amp;nbsp;&amp;minus; Then, click on&amp;nbsp;&lt;strong&gt;Select Files&lt;/strong&gt;&amp;nbsp;option to select the files from your local storage as shown in the following figure.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-media/wordpress-add-media-step2.jpg&quot; alt=&quot;WordPress Add Media&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (3)&lt;/strong&gt;&amp;nbsp;&amp;minus; Add&amp;nbsp;&lt;strong&gt;Media files&lt;/strong&gt;&amp;nbsp;such as images and audios by selecting them and click open as shown in the following screenshot.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-media/wordpress-add-media-step3.jpg&quot; alt=&quot;WordPress Add Media&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (4)&lt;/strong&gt;&amp;nbsp;&amp;minus; You can view the list of&amp;nbsp;&lt;strong&gt;media files&lt;/strong&gt;&amp;nbsp;added as shown in the following screenshot.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-media/wordpress-add-media-step4.jpg&quot; alt=&quot;WordPress Add Media&quot; /&gt;&lt;/p&gt;

&lt;h1&gt;Add Page&lt;/h1&gt;
&lt;p&gt;In this chapter, we will study how to&amp;nbsp;&lt;strong&gt;Add Pages&lt;/strong&gt;&amp;nbsp;into the WordPress. Adding pages is similar to adding posts in WordPress. Pages are static content and often do not change its displayed information.&lt;/p&gt;
&lt;p&gt;Following are the simple steps to add pages in WordPress.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (1)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Pages &amp;rarr; Add New&lt;/strong&gt;&amp;nbsp;as shown in the following screenshot.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-pages/wordpress-add-pages-step1.jpg&quot; alt=&quot;WordPress Add Pages&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (2)&lt;/strong&gt;&amp;nbsp;&amp;minus; You will get the editor page as seen in the following screenshot. The editor page has two tabs, Visual and Text. You can insert text in either of these. Here, we&#39;ll study about inserting text into Visual format.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-pages/wordpress-add-pages-step2.jpg&quot; alt=&quot;WordPress Add Pages&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Following are the details of the fields on editor page of the&amp;nbsp;&lt;strong&gt;Add New Page&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;Title&lt;/h2&gt;
&lt;p&gt;It is used to write the title of the article, which is later displayed on the page.&lt;/p&gt;
&lt;p&gt;Permalink shows the potential URL for the page below the title. The URL generates as per the given title.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-pages/wordpress-add-pages-step3.jpg&quot; alt=&quot;WordPress Add Pages&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;WYSIWYG Editor&lt;/h2&gt;
&lt;p&gt;It is a WYSIWYG Editor, which is similar to a word processor interface where you can edit the contents of the article.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-pages/wordpress-add-pages-step4.jpg&quot; alt=&quot;WordPress Add Pages&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Following are the options present of WYSIWYG editor &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Bold Button&lt;/strong&gt;&amp;nbsp;&amp;minus; Used to bold your font.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Italic&lt;/strong&gt;&amp;nbsp;&amp;minus; Used to italicize the font.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Word Strike&lt;/strong&gt;&amp;nbsp;&amp;minus; Strikes through the content.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Bullet List&lt;/strong&gt;&amp;nbsp;&amp;minus; Adds bullets to content.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Number List&lt;/strong&gt;&amp;nbsp;&amp;minus; Adds numbers to the list of the content.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Blockquote&lt;/strong&gt;&amp;nbsp;&amp;minus; Quotes the text.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Horizontal Line&lt;/strong&gt;&amp;nbsp;&amp;minus; Creates a horizontal line between sentences.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Left Align&lt;/strong&gt;&amp;nbsp;&amp;minus; Sets the content on the left side of the page.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Right Align&lt;/strong&gt;&amp;nbsp;&amp;minus; Sets the content to the right side of the page.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Justify&lt;/strong&gt;&amp;nbsp;&amp;minus; Justifies the content of the page.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Add Link&lt;/strong&gt;&amp;nbsp;&amp;minus; Adds a link to your content. When you click on this button, the following page gets displayed.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-pages/wordpress-add-pages-step5.jpg&quot; alt=&quot;Wordpress Add Pages&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Following are the fields present in the Insert/edit link.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;URL&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter URL you want to link.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Link text&lt;/strong&gt;&amp;nbsp;&amp;minus; Insert text you want to enter into the link.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Open link in a new window/tab&lt;/strong&gt;&amp;nbsp;&amp;minus; Open your link page into the new tab or window. Check the box as required.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Or link to existing account&lt;/strong&gt;&amp;nbsp;&amp;minus; Links to an existing content page by selecting the page from the given list. When you click on existing page then you get a link created in the URL section as seen in the following screenshot.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-pages/wordpress-add-pages-step6.jpg&quot; alt=&quot;Wordpress Add Pages&quot; /&gt;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Remove Link&lt;/strong&gt;&amp;nbsp;&amp;minus; Deletes the particular link added for text or content.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Read more tag&lt;/strong&gt;&amp;nbsp;&amp;minus; Adds&amp;nbsp;&lt;strong&gt;Read More&lt;/strong&gt;&amp;nbsp;tag to your page.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Toolbar toggle&lt;/strong&gt;&amp;nbsp;&amp;minus; Clicking on this you get another list of toolbar as shown in the following image.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-pages/wordpress-add-pages-step7.jpg&quot; alt=&quot;WordPress Add Pages&quot; /&gt;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Paragraph&lt;/strong&gt;&amp;nbsp;&amp;minus; Selects the headings as required for the text from the dropdown.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Underline&lt;/strong&gt;&amp;nbsp;&amp;minus; Underlines the sentences.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Justify&lt;/strong&gt;&amp;nbsp;&amp;minus; Justifies your content.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Text Color&lt;/strong&gt;&amp;nbsp;&amp;minus; Sets color for words or sentences.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Paste as Text&lt;/strong&gt;&amp;nbsp;&amp;minus; Pastes your text.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Clear Formatting&lt;/strong&gt;&amp;nbsp;&amp;minus; Deletes selected content.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Special character&lt;/strong&gt;&amp;nbsp;&amp;minus; Inserts special characters needed in your content.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-pages/wordpress-add-pages-step8.jpg&quot; alt=&quot;WordPress Add Pages&quot; /&gt;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Increase Indent&lt;/strong&gt;&amp;nbsp;&amp;minus; Increases the indent of the page.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Decrease Indent&lt;/strong&gt;&amp;nbsp;&amp;minus; Decreases the indent of the page.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Undo&lt;/strong&gt;&amp;nbsp;&amp;minus; Reverses the most recent editing command.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Redo&lt;/strong&gt;&amp;nbsp;&amp;minus; Opposite of undo, restores the most recent editing command.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Text Insertion&lt;/h2&gt;
&lt;p&gt;For writing the content of an article.&lt;/p&gt;
&lt;h2&gt;Publish&lt;/h2&gt;
&lt;p&gt;To publish the page to the user on the website.&lt;/p&gt;
&lt;h2&gt;Page Attribute&lt;/h2&gt;
&lt;p&gt;Page attributes module allows you to select the parents for your particular page. You can also set order of the pages.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Parent&lt;/strong&gt;&amp;nbsp;&amp;minus; Allows you to select parent page.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Order&lt;/strong&gt;&amp;nbsp;&amp;minus; Sets the order of the page.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-pages/wordpress-add-pages-step9.jpg&quot; alt=&quot;WordPress Add Pages&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Featured Images&lt;/h2&gt;
&lt;p&gt;Includes the images in the pages.&lt;/p&gt;

&lt;h1&gt;Publish Page&lt;/h1&gt;
&lt;p&gt;In this chapter, we will study how to&amp;nbsp;&lt;strong&gt;Publish Pages&lt;/strong&gt;&amp;nbsp;in WordPress. The command, &amp;ldquo;Publish&amp;rdquo; is used to make the pages available to all users wherein each user can view that particular page. Publishing a new page in WordPress is an easy process.&lt;/p&gt;
&lt;p&gt;Following are the steps to Publish Pages in WordPress.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (1)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Pages &amp;rarr; Add New&amp;nbsp;&lt;/strong&gt;in WordPress.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-publish-pages/wordpress-publish-pages-step1.jpg&quot; alt=&quot;WordPress Publish Pages&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (2)&lt;/strong&gt;&amp;nbsp;&amp;minus; You will get the editor as shown in the following screenshot. You can use the WordPress WYSIWYG editor to add the actual content of your page.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-publish-pages/wordpress-publish-pages-step2.jpg&quot; alt=&quot;WordPress Publish Pages&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (3)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Publish&lt;/strong&gt;&amp;nbsp;button as shown in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-publish-pages/wordpress-publish-pages-step3.jpg&quot; alt=&quot;WordPress Publish Pages&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After clicking on publish, your posts get published for the user to view it.&lt;/p&gt;

&lt;h1&gt;Delete Page&lt;/h1&gt;
&lt;p&gt;In this chapter, we will learn to&amp;nbsp;&lt;strong&gt;Delete Pages&lt;/strong&gt;&amp;nbsp;in WordPress.&lt;/p&gt;
&lt;p&gt;Following are the steps to&amp;nbsp;&lt;strong&gt;Delete pages&amp;nbsp;&lt;/strong&gt;in wordPress.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (1)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Pages &amp;rarr; All Pages&lt;/strong&gt;&amp;nbsp;in WordPress.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-delete-pages/wordpress-deletepages-step1.jpg&quot; alt=&quot;WordPress Delete Pages&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (2)&lt;/strong&gt;&amp;nbsp;&amp;minus; You can delete Sample Page (Sample Page is created by default in WordPress). When the cursor hovers on the pages, then a few options gets displayed below the Sample Page. Click on&amp;nbsp;&lt;strong&gt;Trash&lt;/strong&gt;&amp;nbsp;option to delete the post.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-delete-pages/wordpress-deletepages-step2.jpg&quot; alt=&quot;WordPress Delete Pages&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Or alternatively you can also delete your page directly while editing or adding page by clicking on the&amp;nbsp;&lt;strong&gt;Move to Trash&lt;/strong&gt;&amp;nbsp;button as shown in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-delete-pages/wordpress-deletepages-step3.jpg&quot; alt=&quot;WordPress Delete Pages&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (3)&lt;/strong&gt;&amp;nbsp;&amp;minus; To confirm that you have deleted the page, view your page list.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-delete-pages/wordpress-deletepages-step4.jpg&quot; alt=&quot;WordPress Delete Pages&quot; /&gt;&lt;/p&gt;

&lt;h1&gt;Add Tags&lt;/h1&gt;
&lt;p&gt;Tag is a small information attached to the main content or post for the purpose of identification. It tells the visitors what actually the post is about. If the tag is mentioned properly then it helps to find the content very easily.&lt;/p&gt;
&lt;p&gt;Following are the steps to&amp;nbsp;&lt;strong&gt;Add Tags&lt;/strong&gt;&amp;nbsp;in WordPress.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (1)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Posts &amp;rarr; Tags&lt;/strong&gt;&amp;nbsp;in WordPress.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-tags/wordpress-add-tags-step1.jpg&quot; alt=&quot;WordPress Add Tags&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (2)&lt;/strong&gt;&amp;nbsp;&amp;minus; The Tags page is displayed.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-tags/wordpress-add-tags-step2.jpg&quot; alt=&quot;WordPress Add Tags&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Following are the details of the fields on Tags.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Name&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter the name of tags.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Slug&lt;/strong&gt;&amp;nbsp;&amp;minus; A word chosen to describe your post. It is specified in the tags URL.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;&amp;nbsp;&amp;minus; Add brief description of your tag. It gets displayed when you hover on the tag.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After filling all the information about Tags, click on&amp;nbsp;&lt;strong&gt;Add New Tag&lt;/strong&gt;&amp;nbsp;button.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (3)&lt;/strong&gt;&amp;nbsp;&amp;minus; The new created tags will get displayed on the right side of the page as shown in the following screenshot.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-tags/wordpress-add-tags-step3.jpg&quot; alt=&quot;WordPress Add Tags&quot; /&gt;&lt;/p&gt;

&lt;h1&gt;Add Links&lt;/h1&gt;
&lt;p&gt;In this chapter, we will learn to&amp;nbsp;&lt;strong&gt;Add Links&lt;/strong&gt;&amp;nbsp;in WordPress pages. Link is a connection from one resource to another. Adding links to your pages or blog posts help you to connect to other pages.&lt;/p&gt;
&lt;p&gt;Following are the simple steps to&amp;nbsp;&lt;strong&gt;Add links&lt;/strong&gt;&amp;nbsp;in WordPress.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (1)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Pages &amp;rarr; All Pages&lt;/strong&gt;&amp;nbsp;in WordPress.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-links/wordpress-add-links-step1.jpg&quot; alt=&quot;WordPress Add Links&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (2)&lt;/strong&gt;&amp;nbsp;&amp;minus; List of pages created in WordPress will get displayed as shown in the following screen. Select any of the pages to add links inside it. Here, we are going to add links in&amp;nbsp;&lt;em&gt;About Us&lt;/em&gt;&amp;nbsp;page.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-links/wordpress-add-links-step2.jpg&quot; alt=&quot;WordPress Add Links&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (3)&lt;/strong&gt;&amp;nbsp;&amp;minus; Select any of the sentence or word where you want to add link. Here, we will add link to the word&amp;nbsp;&lt;em&gt;Lorem&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-links/wordpress-add-links-step3.jpg&quot; alt=&quot;WordPress Add Links&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (4)&lt;/strong&gt;&amp;nbsp;&amp;minus; When you click on the Insert/Edit link symbol then the following pop window gets displayed.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-links/wordpress-add-links-step4.jpg&quot; alt=&quot;WordPress Add Links&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Following are the fields present in the Insert/edit link.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;URL&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter URL you want to link.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Link text&lt;/strong&gt;&amp;nbsp;&amp;minus; Insert text you want to enter into the link.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Open link in a new window/tab&lt;/strong&gt;&amp;nbsp;&amp;minus; Open your link page into the new tab or window. Check the box as required.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Or link to existing account&lt;/strong&gt;&amp;nbsp;&amp;minus; Add links to an existing content page by selecting the page from the given list. Click on&amp;nbsp;&lt;strong&gt;Or link to existing account&lt;/strong&gt;&amp;nbsp;and the list of pages and posts gets displayed as shown in the following screen.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-links/wordpress-add-links-step5.jpg&quot; alt=&quot;WordPress Add Links&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After selecting the particular page or post from the list, the links get created in the URL field as seen in the preceding screen. Click on&amp;nbsp;&lt;strong&gt;Add Link&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (5)&lt;/strong&gt;&amp;nbsp;&amp;minus; When you hover on the word&amp;nbsp;&lt;em&gt;Lorem&lt;/em&gt;&amp;nbsp;then the link tooltip gets displayed as shown in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-links/wordpress-add-links-step6.jpg&quot; alt=&quot;WordPress Add Links&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Click on&amp;nbsp;&lt;strong&gt;Update&lt;/strong&gt;&amp;nbsp;button to update the changes in your page or post.&lt;/p&gt;

&lt;h1&gt;Add Comments&lt;/h1&gt;
&lt;p&gt;In this chapter, we will learn to&amp;nbsp;&lt;strong&gt;Add Comments&lt;/strong&gt;&amp;nbsp;in WordPress. Adding comments allows your visitors to have a discussion with you. Comments are approved by the admin and then posted to be discussed further.&lt;/p&gt;
&lt;p&gt;Following are the steps to add comments to your blog posts.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (1)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Pages &amp;rarr; All Pages&lt;/strong&gt;&amp;nbsp;in WordPress.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-comments/wordpress-add-comments-step1.jpg&quot; alt=&quot;WordPress Add Comments&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (2)&lt;/strong&gt;&amp;nbsp;&amp;minus; The list of pages created in WordPress will get displayed as seen in the following screen. Select any of the pages you want to add comments to. Here, we are going to add comment in&amp;nbsp;&lt;em&gt;About Us&lt;/em&gt;&amp;nbsp;page. Click on&amp;nbsp;&lt;strong&gt;About Us&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-comments/wordpress-add-comments-step2.jpg&quot; alt=&quot;WordPress Add Comments&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (3)&lt;/strong&gt;&amp;nbsp;&amp;minus; To add a comment on this page, click on&amp;nbsp;&lt;strong&gt;Screen options&lt;/strong&gt;&amp;nbsp;present at the top right hand corner.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-comments/wordpress-add-comments-step3.jpg&quot; alt=&quot;WordPress Add Comments&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (4)&lt;/strong&gt;&amp;nbsp;&amp;minus; The dropdown list of&amp;nbsp;&lt;strong&gt;Screen Option&lt;/strong&gt;&amp;nbsp;gets displayed. Check the&amp;nbsp;&lt;strong&gt;Discussion&lt;/strong&gt;and&amp;nbsp;&lt;strong&gt;Comments&lt;/strong&gt;&amp;nbsp;box as shown in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-comments/wordpress-add-comments-step4.jpg&quot; alt=&quot;WordPress Add Comments&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (5)&lt;/strong&gt;&amp;nbsp;&amp;minus; You can now view the Discussion and Comments box at the bottom of your page.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-comments/wordpress-add-comments-step5.jpg&quot; alt=&quot;WordPress Add Comments&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In the Discussion section, there are two options present &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Allow Comments&lt;/strong&gt;&amp;nbsp;&amp;minus; Allows visitors to comment on your blog posts and pages.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Allow trackbacks and pingbacks on this page&lt;/strong&gt;&amp;nbsp;&amp;minus; Allows visitors to give pings and trackbacks.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In the Comment section, you can add comments by clicking on&amp;nbsp;&lt;strong&gt;Add Comment&lt;/strong&gt;&amp;nbsp;button.&lt;/p&gt;

&lt;h1&gt;Install Plugins&lt;/h1&gt;
&lt;p&gt;In this chapter, we will study how to&amp;nbsp;&lt;strong&gt;install plugins&lt;/strong&gt;&amp;nbsp;in WordPress. It is really easy to install plugins. All the plugins are free to download; the only condition is that a plugin must be in the WordPress directory.&lt;/p&gt;
&lt;p&gt;Following are the simple steps to Install Plugins in WordPress.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (1)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Plugins &amp;rarr; Add New&lt;/strong&gt;&amp;nbsp;in WordPress.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-install-plugins/wordpress-install-plugins-step1.jpg&quot; alt=&quot;wordPress install plugins&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (2)&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter your required plugin name in the&amp;nbsp;&lt;strong&gt;search box&lt;/strong&gt;&amp;nbsp;as shown in the following screen. List of plugins which are relevant to the plugins name will get displayed as seen in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-install-plugins/wordpress-install-plugins-step2.jpg&quot; alt=&quot;wordPress install plugins&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Select the required plugin you want to use. Here, we have searched&amp;nbsp;&lt;strong&gt;All in one SEO Pack&lt;/strong&gt;plugin, which happens to be the first plugin as shown in the preceding screen. Click on&amp;nbsp;&lt;strong&gt;install now&lt;/strong&gt;&amp;nbsp;button to install the plugin on your website.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (3)&lt;/strong&gt;&amp;nbsp;&amp;minus; The plugins automatically start downloading and installing.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-install-plugins/wordpress-install-plugins-step3.jpg&quot; alt=&quot;wordPress install plugins&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Click on&amp;nbsp;&lt;strong&gt;Activate Plugin&lt;/strong&gt;&amp;nbsp;to activate the plugin on your website, which makes your task much easier using this plugin.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (4)&lt;/strong&gt;&amp;nbsp;&amp;minus; Once activated, you will see the installed plugin in the list of plugins as seen in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-install-plugins/wordpress-install-plugins-step4.jpg&quot; alt=&quot;wordPress install plugins&quot; /&gt;&lt;/p&gt;

&lt;h1&gt;User Role&lt;/h1&gt;
&lt;p&gt;In this chapter, we will learn about the roles of users in WordPress. Every user has their own role in WordPress. Roles are like permissions given to a particular user to access the WordPress site. These roles can be allotted only by the Admin.&lt;/p&gt;
&lt;p&gt;Here are few pre-defined roles available in WordPress &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Administrator&lt;/strong&gt;&amp;nbsp;&amp;minus; The Administrator has all the rights. An Admin can do anything and everything on the WordPress site such as creating more admins, inviting more users and also removing them.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Editor&lt;/strong&gt;&amp;nbsp;&amp;minus; The Editor has access to all the posts, pages, comments, categories, tags, and links. They can create, publish, edit or delete any posts or pages.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Author&lt;/strong&gt;&amp;nbsp;&amp;minus; The Author can only write posts, upload pictures, edit, and publish their own posts.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Contributor&lt;/strong&gt;&amp;nbsp;&amp;minus; The Contributor can only write and edit their posts until published. They can create their own posts and pages but cannot publish them. They cannot upload images or files but can see your site&#39;s status. When they want to publish any post, it must be first notified personally to the administrator for review. When the post is approved, the contributor cannot make any changes once published.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Follower&lt;/strong&gt;&amp;nbsp;&amp;minus; The Follower can only read and comment on the posts. Followers are the ones who have signed in to your account to receive updates.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Viewer&lt;/strong&gt;&amp;nbsp;&amp;minus; Viewers can only view your posts; they cannot edit but can only comment on the posts.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;Add User&lt;/h1&gt;
&lt;p&gt;In this chapter, we will study how to&amp;nbsp;&lt;strong&gt;Add users&lt;/strong&gt;&amp;nbsp;to your WordPress blog or website. When users register on your WordPress blog or website, you get an e-mail notification, so you always know when new users register, and you can then get into your Dashboard and edit the users&amp;rsquo; role.&lt;/p&gt;
&lt;p&gt;Following are the simple steps to Add Users in WordPress.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (1)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Users &amp;rarr; Add New&lt;/strong&gt;&amp;nbsp;in WordPress.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-users/wordpress-add-users-step1.jpg&quot; alt=&quot;WordPress Add Users&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (2)&lt;/strong&gt;&amp;nbsp;&amp;minus; You can fill the user detail on the&amp;nbsp;&lt;strong&gt;Add New User&lt;/strong&gt;&amp;nbsp;page. Fill in all the required fields (as seen in the following screen) to proceed further.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-users/wordpress-add-users-step2.jpg&quot; alt=&quot;WordPress Add Users&quot; /&gt;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Username (required)&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter the unique username, which you want to display on website.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;E-mail (required)&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter the valid e-mail address. The user receives notifications from the site at this e-mail address.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;First Name&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter the user&amp;rsquo;s first name.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Last Name&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter the user&amp;rsquo;s last name.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Website&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter the URL for the user&amp;rsquo;s website.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Password (required)&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter the password.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Repeat Password (required)&lt;/strong&gt;&amp;nbsp;&amp;minus; Repeat the same password as the previous password for authentication.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Send Password&lt;/strong&gt;&amp;nbsp;&amp;minus; Send password to the New User by e-mail checkbox. The user will receive an e-mail with the new password.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Role&lt;/strong&gt;&amp;nbsp;&amp;minus; Select the particular role from the dropdown, i.e., Subscriber, Contributor, Author, Editor, or Administrator.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Click on&amp;nbsp;&lt;strong&gt;Add New User&lt;/strong&gt;&amp;nbsp;button to add user to your users list.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (3)&lt;/strong&gt;&amp;nbsp;&amp;minus; You can view the user list to see whether the users have been added. A message will be displayed as&amp;nbsp;&lt;strong&gt;New User Created&lt;/strong&gt;&amp;nbsp;as seen in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-add-users/wordpress-add-users-step3.jpg&quot; alt=&quot;WordPress Add Users&quot; /&gt;&lt;/p&gt;

&lt;h1&gt;Personal Profile&lt;/h1&gt;
&lt;p&gt;In this chapter, we will learn how to create a Personal profile in WordPress.&lt;/p&gt;
&lt;p&gt;Following are the steps to&amp;nbsp;&lt;strong&gt;Personal Profile.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step(1)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Users &amp;rarr; Your Profile&lt;/strong&gt;&amp;nbsp;from the left navigation bar.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-personal-profile/Wordpress-personal-profile-step1.jpg&quot; alt=&quot;WordPress Personal Profile&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (2)&lt;/strong&gt;&amp;nbsp;&amp;minus; When you click on&amp;nbsp;&lt;strong&gt;&amp;lsquo;Your profile&amp;rsquo;&lt;/strong&gt;&amp;nbsp;the following screen will be displayed.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-personal-profile/wordpress-personal-profile-step2.jpg&quot; alt=&quot;WordPress Personal Profile&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The following&amp;nbsp;&lt;strong&gt;Personal options&lt;/strong&gt;&amp;nbsp;appear on the screen &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Visual editor&lt;/strong&gt;&amp;nbsp;&amp;minus; While you are adding posts/pages to your site you can enable this setting if you wish to create, format, or edit your post. If you disable this setting, you won&amp;rsquo;t be able to use this option.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Admin color scheme&lt;/strong&gt;&amp;nbsp;&amp;minus; You can change the color of your WordPress site by selecting any of the following.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Keyboard Shortcuts&lt;/strong&gt;&amp;nbsp;&amp;minus; If you are too fast at getting your work done and need keyboard shortcuts then you can check this box.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Toolbar&lt;/strong&gt;&amp;nbsp;&amp;minus; If you check this box, you can view the toolbar while using WordPress.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Name&lt;/strong&gt;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Username&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter your user name.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;First Name/ Last Name&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter your first name and last name.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Nick name&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter nick names if any.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Display name publicly as&lt;/strong&gt;&amp;nbsp;&amp;minus; Check the box if you want your name to be displayed publicly.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Contact Info&lt;/strong&gt;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;E-mail&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter a valid e-mail address.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Website&lt;/strong&gt;&amp;nbsp;&amp;minus; Type in your web address.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;About yourself&lt;/strong&gt;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Biographical Info&lt;/strong&gt;&amp;nbsp;&amp;minus; Some details about you.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;New password&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter a password of your choice.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Repeat password&lt;/strong&gt;&amp;nbsp;&amp;minus; Re-enter the password for authentication. Password must contain 7 characters.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Your photo&lt;/strong&gt;&amp;nbsp;&amp;minus; You can upload an image of your own from your computer. This will be your profile picture.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Step (3)&lt;/strong&gt;&amp;nbsp;&amp;minus; After you have updated all the changes, click on&amp;nbsp;&lt;strong&gt;Update Profile&lt;/strong&gt;.&lt;/p&gt;

&lt;h1&gt;Theme Management&lt;/h1&gt;
&lt;p&gt;In this chapter, we will learn about&amp;nbsp;&lt;strong&gt;Theme management&lt;/strong&gt;. It includes image files, templates, CSS stylesheets, etc. that can help to make your website look great. This chapter discusses how to install, add new, or customize themes in WordPress.&lt;/p&gt;
&lt;p&gt;Following are the steps for&amp;nbsp;&lt;strong&gt;Theme Management&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (1)&lt;/strong&gt;&amp;nbsp;&amp;minus; Select&amp;nbsp;&lt;strong&gt;Appearance &amp;rarr; Themes&lt;/strong&gt;&amp;nbsp;from the dashboard.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-theme-management/wordpress-theme-management-step1.jpg&quot; alt=&quot;WordPress Theme Manegement&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (2)&lt;/strong&gt;&amp;nbsp;&amp;minus; The following screen will be displayed. Hover over any theme and click on&amp;nbsp;&lt;strong&gt;Theme Details&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-theme-management/wordpress-theme-management-step2%202.jpg&quot; alt=&quot;WordPress Theme Management&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-theme-management/wordpress-theme-management-step3.jpg&quot; alt=&quot;WordPress Theme Management&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (3) &amp;minus;&lt;/strong&gt;&amp;nbsp;When you click on&amp;nbsp;&lt;strong&gt;Theme Detail&lt;/strong&gt;&amp;nbsp;the following page appears. It consists of details related to the theme. Details like version, description, tags etc.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-theme-management/wordpress-theme-management-step4.jpg&quot; alt=&quot;WordPress Theme Management&quot; /&gt;&lt;/p&gt;
&lt;p&gt;If you want to add this theme to your page/website then click on&amp;nbsp;&lt;strong&gt;Activate&lt;/strong&gt;, and if you want to just check the theme, then click on&amp;nbsp;&lt;strong&gt;Live preview&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;If you click on activate then you get a pop-up message as &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-theme-management/wordpress-theme-management-step5.jpg&quot; alt=&quot;WordPress Theme Management&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (4)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Customize&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-theme-management/wordpress-theme-management-step6.jpg&quot; alt=&quot;WordPress Theme Management&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (5)&lt;/strong&gt;&amp;nbsp;&amp;minus; On the left side of the page, you can customize your theme. Any changes you make or anything new you add is displayed on the right side of the page.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-theme-management/wordpress-theme-management-step7.jpg&quot; alt=&quot;WordPress Theme Management&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We will learn about customizing the appearance of the themes in the next chapter i.e.;&amp;nbsp;&lt;strong&gt;WordPress Customize Theme&lt;/strong&gt;.&lt;/p&gt;

&lt;h1&gt;Customize Theme&lt;/h1&gt;
&lt;p&gt;In this chapter, we will learn how to customize themes. Customizing themes help you to give a new look to your website. Here you can change background images/colors, add titles, and do much more.&lt;/p&gt;
&lt;p&gt;Following are the steps of&amp;nbsp;&lt;strong&gt;Customize theme&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (1)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Appearance &amp;rarr; Customize&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-customize-theme/wordpress-customize-theme-step1.jpg&quot; alt=&quot;WordPress Customize Theme&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (2)&lt;/strong&gt;&amp;nbsp;&amp;minus; The following screen will be displayed.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-customize-theme/wordpress-customize-theme-step2.jpg&quot; alt=&quot;WordPress Customize Theme&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As can be seen, on the left side we have the customizing section, and on the right side we have the theme you have chosen. So any changes you make on the left side will be displayed on the right side of the page. Here are a few options you must know &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Active theme&lt;/strong&gt;&amp;nbsp;&amp;minus; In this section, you can change the current theme just by clicking on&amp;nbsp;&lt;strong&gt;&amp;lsquo;Change&amp;rsquo;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-customize-theme/wordpress-customize-theme-step3.jpg&quot; alt=&quot;WordPress Customize Theme&quot; /&gt;&lt;/p&gt;
&lt;p&gt;When you click on&amp;nbsp;&lt;strong&gt;&amp;lsquo;Change&amp;rsquo;&lt;/strong&gt;&amp;nbsp;you get a list of themes, click on any of the themes, and then click&amp;nbsp;&lt;strong&gt;&amp;lsquo;Save &amp;amp; Continue&amp;rsquo;&lt;/strong&gt;. Your theme will be saved.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-customize-theme/wordpress-customize-theme-step4.jpg&quot; alt=&quot;WordPress Customize Theme&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Site Title &amp;amp; Tagline&lt;/strong&gt;&amp;nbsp;&amp;minus; In this section, you can add the site title and tagline you want to add to your website.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-customize-theme/wordpress-customize-theme-step5.jpg&quot; alt=&quot;WordPress Customize Theme&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Add your title name in the&amp;nbsp;&lt;strong&gt;&amp;lsquo;Site Title&amp;rsquo;&lt;/strong&gt;&amp;nbsp;section. And your tagline in the&amp;nbsp;&lt;strong&gt;&amp;lsquo;Tagline&amp;rsquo; box&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Colors&lt;/strong&gt;&amp;nbsp;&amp;minus; You can change your header text color using this section. As you scroll through the colors you find changes happening on the right side of your page. You can even add a color of your own into the box that is situated in between&amp;nbsp;&lt;strong&gt;&amp;lsquo;Current color&amp;rsquo; and &amp;lsquo;Default&amp;rsquo;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-customize-theme/wordpress-customize-theme-step6.jpg&quot; alt=&quot;WordPress Customize Theme&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Header Image&lt;/strong&gt;&amp;nbsp;&amp;minus; Add a header image either by selecting from the suggestions or you can add an image of your own by clicking on&amp;nbsp;&lt;strong&gt;&amp;lsquo;Add new image&amp;rsquo;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-customize-theme/wordpress-customize-theme-step7.jpg&quot; alt=&quot;WordPress Customize Theme&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Widgets&lt;/strong&gt;&amp;nbsp;&amp;minus; Add widgets to your site from here.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-customize-theme/wordpress-customize-theme-step8.jpg&quot; alt=&quot;WordPress Customize Theme&quot; /&gt;&lt;/p&gt;
&lt;p&gt;When you click on the arrow mark the following image appears.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-customize-theme/wordpress-customize-theme-step9.jpg&quot; alt=&quot;WordPress Customize Theme&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Here, there are two options &amp;minus;&lt;/p&gt;
&lt;p&gt;First is the&amp;nbsp;&lt;strong&gt;&amp;lsquo;Main Widget Area&amp;rsquo;&lt;/strong&gt;, when you click on this you get another list of widgets that are to be displayed in the footer area.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-customize-theme/wordpress-customize-theme-step10.jpg&quot; alt=&quot;WordPress Customize Theme&quot; /&gt;&lt;/p&gt;
&lt;p&gt;When you click on any of the widgets a dropdown appears where you can edit more or add more. For example &amp;minus; If you want to add categories then the following image appears.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-customize-theme/wordpress-customize-theme-step11.jpg&quot; alt=&quot;WordPress Customize Theme&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In this image, as you can see, you can add your category in the&amp;nbsp;&lt;strong&gt;&amp;lsquo;Title&amp;rsquo;&lt;/strong&gt;&amp;nbsp;section. Check any of the required boxes. If you do not want to add any, then say&amp;nbsp;&lt;strong&gt;&amp;lsquo;Remove&amp;rsquo;&lt;/strong&gt;. Same goes for other widgets too.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Secondary Widget&lt;/strong&gt;&amp;nbsp;&amp;minus; Here you must click on&amp;nbsp;&lt;strong&gt;&amp;lsquo;Add a widget&amp;rsquo;&lt;/strong&gt;&amp;nbsp;and you get a side bar with a list of different widgets. Click on any and it adds up to your widget list.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-customize-theme/wordpress-customize-theme-step14.jpg&quot; alt=&quot;WordPress Customize Theme&quot; /&gt;&lt;/p&gt;
&lt;p&gt;If you want to add more widgets then click on&amp;nbsp;&lt;strong&gt;&amp;lsquo;Add a widget&amp;rsquo;&lt;/strong&gt;&amp;nbsp;again and you can add as many widgets as you want.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-customize-theme/wordpress-customize-theme-step12.jpg&quot; alt=&quot;WordPress Customize Theme&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Static Front&lt;/strong&gt;&amp;nbsp;&amp;minus; Select either latest posts or static front page for your site.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-customize-theme/wordpress-customize-theme-step13.jpg&quot; alt=&quot;WordPress Customize Theme&quot; /&gt;&lt;/p&gt;

&lt;h1&gt;Widget Management&lt;/h1&gt;
&lt;p&gt;In this chapter, we will study about&amp;nbsp;&lt;strong&gt;Widget Management&lt;/strong&gt;. Widgets are small blocks that perform specific functions. These give design and structure control to the WordPress theme. Some specific features of a widget are &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;They help you add content and features.&lt;/li&gt;
&lt;li&gt;They can be easily dragged and dropped in widget area.&lt;/li&gt;
&lt;li&gt;They vary from theme to theme. They are not same for every theme.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Step (1)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Appearance &amp;rarr; Widgets&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-widget-management/wordpress-widget-management-step1.jpg&quot; alt=&quot;WordPress Widget Management&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (2)&lt;/strong&gt;&amp;nbsp;&amp;minus; The following screen showing available widgets appear.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-widget-management/wordpress-widget-management-step2.jpg&quot; alt=&quot;WordPress Widget Management&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The following functions appear on the page &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Available Widgets&lt;/strong&gt;&amp;nbsp;&amp;minus; You can use these to add into your sidebar main.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Inactive Sidebar (not used)&lt;/strong&gt;&amp;nbsp;&amp;minus; These are not used and can be removed permanently from the widget list.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Inactive Widgets&lt;/strong&gt;&amp;nbsp;&amp;minus; Removes the widgets from sidebar but keep it in the settings.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Sidebar Main&lt;/strong&gt;&amp;nbsp;&amp;minus; Any widget you add here will appear on your site.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Manage in Customizer&lt;/strong&gt;&amp;nbsp;&amp;minus; Takes you back to customization page.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-widget-management/wordpress-widget-management-step3a.jpg&quot; alt=&quot;WordPress Widget Management&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-widget-management/wordpress-widget-management-step3b.jpg&quot; alt=&quot;WordPress Widget Management&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (3)&lt;/strong&gt;&amp;nbsp;&amp;minus; Drag and drop in the&amp;nbsp;&lt;strong&gt;Sidebar Main&lt;/strong&gt;. Any widget you add here, shows up on your site.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-widget-management/wordpress-widget-management-step4.jpg&quot; alt=&quot;WordPress Widget Management&quot; /&gt;&lt;/p&gt;

&lt;h1&gt;Host Transfer&lt;/h1&gt;
&lt;p&gt;In this chapter, we will study how to transfer WordPress to a new hosting platform.&lt;/p&gt;
&lt;p&gt;Here, we have used Hostinger web hosting to transfer the WordPress site to another host.&lt;/p&gt;
&lt;p&gt;Just follow the simple steps given below to transfer your WordPress site to another host.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (1)&lt;/strong&gt;&amp;nbsp;&amp;minus; Keep the backup of WordPress files and export the database. We will study about this in detail in the chapter&amp;nbsp;&lt;a href=&quot;https://www.tutorialspoint.com/wordpress/wordpress_backup_restore.htm&quot;&gt;WordPress - Backup &amp;amp; Restore&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (2)&lt;/strong&gt;&amp;nbsp;&amp;minus; Login to your cPanel and click on&amp;nbsp;&lt;strong&gt;MySQL Databases&lt;/strong&gt;&amp;nbsp;as shown in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-host-transfer/wordpress-host-transfer-step1.jpg&quot; alt=&quot;WordPress Host Transfer&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (3)&lt;/strong&gt;&amp;nbsp;&amp;minus; Create a new database and MySQL user as shown in the following screen. The page has the following fields &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-host-transfer/wordpress-host-transfer-step2.jpg&quot; alt=&quot;WordPress Host Transfer&quot; /&gt;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;MySQL Database Name&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter your database name.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;MySQL Username&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter your username.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Password&lt;/strong&gt;&amp;nbsp;&amp;minus; Set password for your database.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Password again&lt;/strong&gt;&amp;nbsp;&amp;minus; Once again set the same password as previous for authentication.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After filling all the fields, Click on&amp;nbsp;&lt;strong&gt;Create&lt;/strong&gt;&amp;nbsp;button.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (4)&lt;/strong&gt;&amp;nbsp;&amp;minus; You can view your created&amp;nbsp;&lt;strong&gt;MySQL database, User&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;Host&lt;/strong&gt;&amp;nbsp;as shown in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-host-transfer/wordpress-host-transfer-step3.jpg&quot; alt=&quot;WordPress Host Transfer&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (5)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on + symbol.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-host-transfer/wordpress-host-transfer-step4.jpg&quot; alt=&quot;WordPress Host Transfer&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (6)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;phpMyAdmin&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-host-transfer/wordpress-host-transfer-step5.jpg&quot; alt=&quot;WordPress Host Transfer&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (7)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Import&lt;/strong&gt;&amp;nbsp;tab on the phpMyAdmin page.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-host-transfer/wordpress-host-transfer-step6.jpg&quot; alt=&quot;WordPress Host Transfer&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (8)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Choose File&lt;/strong&gt;&amp;nbsp;button to select the backup file from your system and click on&amp;nbsp;&lt;strong&gt;Go&lt;/strong&gt;&amp;nbsp;button.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-host-transfer/wordpress-host-transfer-step7.jpg&quot; alt=&quot;WordPress Host Transfer&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (9)&lt;/strong&gt;&amp;nbsp;&amp;minus; You can view the tables of database uploaded as shown in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-host-transfer/wordpress-host-transfer-step8.jpg&quot; alt=&quot;WordPress Host Transfer&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (10)&lt;/strong&gt;&amp;nbsp;&amp;minus; Upload your WordPress files by using file transfer protocol(FileZilla) as shown in the chapter&amp;nbsp;&lt;a href=&quot;https://www.tutorialspoint.com/wordpress/wordpress_backup_restore.htm&quot;&gt;WordPress - Backup &amp;amp; Restore&lt;/a&gt;&amp;nbsp;in&amp;nbsp;&lt;strong&gt;Restoring WordPress Files&lt;/strong&gt;&amp;nbsp;section.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (11)&lt;/strong&gt;&amp;nbsp;&amp;minus; Edit wp-config.php file as mentioned in the Restoring WordPress Files section in chapter&amp;nbsp;&lt;a href=&quot;https://www.tutorialspoint.com/wordpress/wordpress_backup_restore.htm&quot;&gt;WordPress - Backup &amp;amp; Restore&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (12)&lt;/strong&gt;&amp;nbsp;&amp;minus; Inside the Website section of hostinger, Click on&amp;nbsp;&lt;strong&gt;Auto Installer&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-host-transfer/wordpress-host-transfer-step9.jpg&quot; alt=&quot;WordPress Host Transfer&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (13)&lt;/strong&gt;&amp;nbsp;&amp;minus; You can view the uploaded file of the WordPress. Click on the URL link as shown in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-host-transfer/wordpress-host-transfer-step10.jpg&quot; alt=&quot;WordPress Host Transfer&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (14)&lt;/strong&gt;&amp;nbsp;&amp;minus; You can view the login page of WordPress.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-host-transfer/wordpress-host-transfer-step11.jpg&quot; alt=&quot;WordPress Host Transfer&quot; /&gt;&lt;/p&gt;

&lt;h1&gt;Spam Protection&lt;/h1&gt;
&lt;p&gt;In this chapter, we will learn how to protect your WordPress blog or website from&amp;nbsp;&lt;strong&gt;spam&lt;/strong&gt;. Make sure that your WordPress script is updated to the latest stable version. WordPress comes with a preinstalled&amp;nbsp;&lt;strong&gt;antispam solution - Akismet&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;You can activate Akismet, for which you should have a WordPress API key. You have to register at the official WordPress website. The key will be sent to your mail box.&lt;/p&gt;
&lt;p&gt;Following are the steps to follow to enable&amp;nbsp;&lt;strong&gt;Akismet Spam Protection&lt;/strong&gt;&amp;nbsp;plugin for your website or blog.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (1)&lt;/strong&gt;&amp;nbsp;&amp;minus; Go to your WordPress&amp;nbsp;&lt;strong&gt;admin area &amp;rarr; Plugins &amp;rarr; Installed&lt;/strong&gt;. The following screen will be displayed.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-spam-protection/wordpress-spam-protection%20step1.jpg&quot; alt=&quot;WordPress Spam Protection&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (2)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Activate&lt;/strong&gt;&amp;nbsp;button as shown in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-spam-protection/wordpress-spam-protection%20step2.jpg&quot; alt=&quot;WordPress Spam Protection&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (3)&lt;/strong&gt;&amp;nbsp;&amp;minus; The&amp;nbsp;&lt;strong&gt;Akismet&lt;/strong&gt;&amp;nbsp;plugin will be activated and then Click on&amp;nbsp;&lt;strong&gt;Activate your Akismet account&lt;/strong&gt;&amp;nbsp;button as shown in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-spam-protection/wordpress-spam-protection%20step3.jpg&quot; alt=&quot;WordPress Spam Protection&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (4)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Get your API key&lt;/strong&gt;&amp;nbsp;as seen in the following screen to get a new key or enter manually, if you already have API key.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-spam-protection/wordpress-spam-protection%20step4.jpg&quot; alt=&quot;WordPress Spam Protection&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (5)&lt;/strong&gt;&amp;nbsp;&amp;minus; If you don&#39;t have API key then, click on&amp;nbsp;&lt;strong&gt;GET AN AKISMET API KEY&lt;/strong&gt;&amp;nbsp;tab to move further.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-spam-protection/wordpress-spam-protection%20step5.jpg&quot; alt=&quot;WordPress Spam Protection&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (6)&lt;/strong&gt;&amp;nbsp;&amp;minus; Fill up the required fields and click on&amp;nbsp;&lt;strong&gt;Sign up&lt;/strong&gt;&amp;nbsp;button as shown in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-spam-protection/wordpress-spam-protection%20step6.jpg&quot; alt=&quot;WordPress Spam Protection&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (7)&lt;/strong&gt;&amp;nbsp;&amp;minus; Once you complete with&amp;nbsp;&lt;strong&gt;signup process&lt;/strong&gt;. You will get an&amp;nbsp;&lt;strong&gt;API key&lt;/strong&gt;&amp;nbsp;in your registered e-mail id. Enter API key manually and click on&amp;nbsp;&lt;strong&gt;Use this key&lt;/strong&gt;&amp;nbsp;button as seen in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-spam-protection/wordpress-spam-protection%20step7.jpg&quot; alt=&quot;WordPress Spam Protection&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (8)&lt;/strong&gt;&amp;nbsp;&amp;minus; If you have entered a correct&amp;nbsp;&lt;strong&gt;API key&lt;/strong&gt;, it will be verified and you will get a confirmation message as reflected in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-spam-protection/wordpress-spam-protection%20step8.jpg&quot; alt=&quot;WordPress Spam Protection&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (9)&lt;/strong&gt;&amp;nbsp;&amp;minus; Now your blog will be protected from spam by Akismet. You will be able to check the comments in your blog for spam, as well as manually mark comments as spam from the blog&amp;nbsp;&lt;strong&gt;admin area &amp;rarr; Comments&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-spam-protection/wordpress-spam-protection%20step9.jpg&quot; alt=&quot;WordPress Spam Protection&quot; /&gt;&lt;/p&gt;
&lt;p&gt;You can keep a track of how many&amp;nbsp;&lt;strong&gt;spam&lt;/strong&gt;&amp;nbsp;posts have been stopped by Akismet and you can secure your posts, blogs, comments, etc. Furthermore, you can prevent your website from spammers, who can harm your site.&lt;/p&gt;

&lt;h1&gt;Back Up&lt;/h1&gt;
&lt;p&gt;In this chapter, we will study how to&amp;nbsp;&lt;strong&gt;Backup &amp;amp; Restore&lt;/strong&gt;&amp;nbsp;files and database in WordPress. In WordPress there are two parts of backing up such as &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;WordPress Files Backup&lt;/li&gt;
&lt;li&gt;WordPress Database Backup&lt;/li&gt;
&lt;li&gt;WordPress Files Restore&lt;/li&gt;
&lt;li&gt;WordPress Database Restore&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;WordPress Files Backup&lt;/h2&gt;
&lt;p&gt;To get the backup files of WordPress, you need to install FileZilla Client on your system.&lt;/p&gt;
&lt;p&gt;Following are the simple steps used for files backup operation in WordPress &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (1)&lt;/strong&gt;&amp;nbsp;&amp;minus; Open the FileZilla Client as shown in the following screenshot.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-backuprestore/wordpress-backuprestore-step5.jpg&quot; alt=&quot;WordPress Backup and Restore&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (2)&lt;/strong&gt;&amp;nbsp;&amp;minus; Enter the&amp;nbsp;&lt;strong&gt;Host, Username, Password&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;Port&lt;/strong&gt;&amp;nbsp;like you have used to log-in to your cPanel.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-backuprestore/wordpress-backuprestore-step6.jpg&quot; alt=&quot;WordPress Backup and Restore&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After filling all the fields, click on&amp;nbsp;&lt;strong&gt;Quickconnect&lt;/strong&gt;&amp;nbsp;button.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (3)&lt;/strong&gt;&amp;nbsp;&amp;minus; You will get all files and folders of your WordPress site on the right side as seen in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-backuprestore/wordpress-backuprestore-step7.jpg&quot; alt=&quot;WordPress Backup and Restore&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (4)&lt;/strong&gt;&amp;nbsp;&amp;minus; Select all the files and folders and right click on the mouse and click on&amp;nbsp;&lt;strong&gt;Download&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-backuprestore/wordpress-backuprestore-step8.jpg&quot; alt=&quot;WordPress Backup and Restore&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After downloading the WordPress files from cPanel, it will be saved on your system.&lt;/p&gt;
&lt;h2&gt;WordPress Database Backup&lt;/h2&gt;
&lt;p&gt;Following are the simple steps for database backup in WordPress &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (1)&lt;/strong&gt;&amp;nbsp;&amp;minus; Type the path&amp;nbsp;&lt;em&gt;http://localhost/phpmyadmin&lt;/em&gt;&amp;nbsp;in your browser. You will get the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-backuprestore/wordpress-backuprestore-step1.jpg&quot; alt=&quot;WordPress Backup and Restore&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (2)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on the database name &amp;lsquo;wordpress&amp;rsquo; which you have created for WordPress.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-backuprestore/wordpress-backuprestore-step2.jpg&quot; alt=&quot;WordPress Backup and Restore&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (3)&lt;/strong&gt;&amp;nbsp;&amp;minus; After clicking on database&amp;nbsp;&lt;em&gt;wordpress&lt;/em&gt;, it will open the following page. Click on&amp;nbsp;&lt;strong&gt;Export&lt;/strong&gt;&amp;nbsp;tab.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-backuprestore/wordpress-backuprestore-step3.jpg&quot; alt=&quot;WordPress Backup and Restore&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (4)&lt;/strong&gt;&amp;nbsp;&amp;minus; You will get two methods to export the database i.e.&amp;nbsp;&lt;strong&gt;Quick&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;Custom&lt;/strong&gt;. Select any one of the methods and click on&amp;nbsp;&lt;strong&gt;Go&lt;/strong&gt;&amp;nbsp;button.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-backuprestore/wordpress-backuprestore-step4.jpg&quot; alt=&quot;WordPress Backup and Restore&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After exporting the database file, it will get saved on your system.&lt;/p&gt;
&lt;h2&gt;Restoring WordPress Files&lt;/h2&gt;
&lt;p&gt;Following are the simple steps used to restore the files in WordPress using ftp &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (1)&lt;/strong&gt;&amp;nbsp;&amp;minus; Open the FileZilla Client and login to your site using ftp as shown in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-backuprestore/wordpress-backuprestore-step9.jpg&quot; alt=&quot;WordPress Backup and Restore&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (2)&lt;/strong&gt;&amp;nbsp;&amp;minus; Open the local directory in ftp and upload all WordPress files to your website as shown in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-backuprestore/wordpress-backuprestore-step10.jpg&quot; alt=&quot;WordPress Backup and Restore&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (3)&lt;/strong&gt;&amp;nbsp;&amp;minus; Then, go to&amp;nbsp;&lt;strong&gt;your wordpress folder &amp;rarr; wp-config.php&lt;/strong&gt;&amp;nbsp;file. Copy and rename&amp;nbsp;&lt;strong&gt;wp-config.php&lt;/strong&gt;&amp;nbsp;file before editing, in case of some mistake you can restore this file back.&lt;/p&gt;
&lt;p&gt;Open the&amp;nbsp;&lt;strong&gt;wp-config.php&lt;/strong&gt;&amp;nbsp;file and locate the following code.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;define(&#39;DB_NAME&#39;, &#39;db_name&#39;);
&lt;/pre&gt;
&lt;p&gt;Replace the db_name with your database name which you have created.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;define(&#39;DB_USER&#39;, &#39;db_user&#39;);
&lt;/pre&gt;
&lt;p&gt;Replace the db_user with your username of MySql.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;define(&#39;DB_PASSWORD&#39;, &#39;db_password&#39;);
&lt;/pre&gt;
&lt;p&gt;Replace the db_password with your password of MySql.&lt;/p&gt;
&lt;p&gt;Save your wp-config file after editing and upload it to your WordPress site through ftp.&lt;/p&gt;
&lt;h2&gt;Restoring WordPress Database&lt;/h2&gt;
&lt;p&gt;Following are the steps used to restore the database in WordPress &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (1)&lt;/strong&gt;&amp;nbsp;&amp;minus; Type the path&amp;nbsp;&lt;em&gt;http://localhost/phpmyadmin&lt;/em&gt;&amp;nbsp;in the browser. The following screen will pop up.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-backuprestore/wordpress-backuprestore-step11.jpg&quot; alt=&quot;WordPress Backup and Restore&quot; /&gt;&lt;/p&gt;
&lt;p&gt;You can create a new database or import your backup in the existing database.&lt;/p&gt;
&lt;p&gt;Here we&#39;ll create a new database name, i.e.,&amp;nbsp;&lt;strong&gt;new_wordpress&lt;/strong&gt;&amp;nbsp;and click on&amp;nbsp;&lt;strong&gt;Create&lt;/strong&gt;&amp;nbsp;button.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (2)&lt;/strong&gt;&amp;nbsp;&amp;minus; You can view your created database as shown in the following screen. Click on the database name&amp;nbsp;&lt;strong&gt;new_wordpress&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-backuprestore/wordpress-backuprestore-step12.jpg&quot; alt=&quot;WordPress Backup and Restore&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (3)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Import&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-backuprestore/wordpress-backuprestore-step13.jpg&quot; alt=&quot;WordPress Backup and Restore&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (4)&lt;/strong&gt;&amp;nbsp;&amp;minus; Click on&amp;nbsp;&lt;strong&gt;Choose File&lt;/strong&gt;&amp;nbsp;button to select the backup file from your system. After uploading the sql file, select format as&amp;nbsp;&lt;strong&gt;SQL&lt;/strong&gt;&amp;nbsp;as shown in the following screen.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-backuprestore/wordpress-backuprestore-step14.jpg&quot; alt=&quot;WordPress Backup and Restore&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Click on&amp;nbsp;&lt;strong&gt;Go&lt;/strong&gt;&amp;nbsp;button.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step (5)&lt;/strong&gt;&amp;nbsp;&amp;minus; Once you click on Go, you will get a message after the sql file is uploaded successfully.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/wordpress/images/wordpress-backuprestore/wordpress-backuprestore-step15.jpg&quot; alt=&quot;WordPress Backup and Restore&quot; /&gt;&lt;/p&gt;

&lt;h1&gt;Optimization&lt;/h1&gt;
&lt;p&gt;In this chapter, we will study how to&amp;nbsp;&lt;strong&gt;Optimize&lt;/strong&gt;&amp;nbsp;WordPress site.&lt;/p&gt;
&lt;p&gt;Here are a few simple tips to optimize your WordPress site.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;Ensure high quality and meaningful content.&lt;/li&gt;
&lt;li&gt;Have the right names for images.&lt;/li&gt;
&lt;li&gt;Use short permalinks that contain keywords.&lt;/li&gt;
&lt;li&gt;Have optimized themes.&lt;/li&gt;
&lt;li&gt;Sitemap should be in XML format.&lt;/li&gt;
&lt;li&gt;Connect posts to social networks.&lt;/li&gt;
&lt;li&gt;Beware of black hat techniques.&lt;/li&gt;
&lt;li&gt;Delete your trash box.&lt;/li&gt;
&lt;li&gt;Keep Checking Your Site Statistics&lt;/li&gt;
&lt;li&gt;Keep checking your plugins.&lt;/li&gt;
&lt;li&gt;Use CSS and JavaScript effectively.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Ensure High Quality and Meaningful Content&lt;/h3&gt;
&lt;p&gt;Any page you create, the most important thing that matters is the content. You must have good content with keywords that can be helpful for users, not for the search engines. Content should be understandable and not complicated or difficult to read.&lt;/p&gt;
&lt;h3&gt;Have the right names for images&lt;/h3&gt;
&lt;p&gt;The names you choose for your images must be unique; consider choosing images keeping the user in mind. Use keywords that might be helpful for the users. Have some specific names for your images and don&amp;rsquo;t forget to add your alt tags and title tags to your images.&lt;/p&gt;
&lt;p&gt;For example &amp;minus; If your image is about Chocolate sundae Ice-cream then do not mention the name as DSC12346, instead put it as &amp;lsquo;Chocolate-sundae-High-street-restaurant-new-york.jpg&amp;rsquo;. This would be much easier to search.&lt;/p&gt;
&lt;h3&gt;Use short permalinks that contain keywords&lt;/h3&gt;
&lt;p&gt;The permalinks you use must be understandable. For example &amp;minus; Use http://www.mywebsite.com/tutorialspoint/telangana/ instead of http://www.mywebsite.com/page-id?5631456325&lt;/p&gt;
&lt;h3&gt;Have optimized themes&lt;/h3&gt;
&lt;p&gt;Use those themes that are fast and are optimized for WordPress so that when applied to a website, it must not have low speed.&lt;/p&gt;
&lt;h3&gt;Sitemap should be in XML format&lt;/h3&gt;
&lt;p&gt;Google has many tools that can be useful. Tools like Website Optimizer, Webmaster Central, and Google XML sitemaps are very easy to use.&lt;/p&gt;
&lt;h3&gt;Connect posts to social media&lt;/h3&gt;
&lt;p&gt;Social media is a very important aspect today. So have them connected to your blog posts, pages, etc., to have good ranks and popularity. Help promote others posts and pages too and they will do the same in return.&lt;/p&gt;
&lt;h3&gt;Beware of black hat techniques&lt;/h3&gt;
&lt;p&gt;Don&amp;rsquo;t trick Google as it finds you in no time. Don&amp;rsquo;t put yourself in trouble and create problems for your site by using black hat techniques. Be sure to use genuine SEO techniques.&lt;/p&gt;
&lt;h3&gt;Delete your trash box&lt;/h3&gt;
&lt;p&gt;Always consider clearing your trash for more speed and to have a good flow with your website.&lt;/p&gt;
&lt;h3&gt;Keep checking your site statistics&lt;/h3&gt;
&lt;p&gt;Size of page matters a lot. The more images, flash, videos or media related posts on your page, the more it would be slower to load.&amp;nbsp;&lt;em&gt;Yslowi&amp;gt;&lt;/em&gt;&amp;nbsp;module plugin is recommended to help you get a faster page browsing.&lt;/p&gt;
&lt;h3&gt;Check plugins&lt;/h3&gt;
&lt;p&gt;Having many plugins in WordPress may also be the reason for your page to slow load. So keep a check on your plugins which you&amp;rsquo;re working on. Consider checking your plugins before you add them.&lt;/p&gt;
&lt;h3&gt;Use CSS and JavaScript effectively&lt;/h3&gt;
&lt;p&gt;Always keep your CSS at the upper side of the page and JavaScript at the bottom. Let CSS load first and then JavaScript. Here is a plugin that will help you get your JavaScript&amp;rsquo;s at the bottom of the page. It is&amp;nbsp;&lt;a href=&quot;http://www.prelovac.com/vladimir/wordpress-plugins/footer-javascript/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;Footer javaScript&lt;/a&gt;.&lt;/p&gt;
&lt;script&gt;mbtTOC();&lt;/script&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;http://feeds.feedburner.com/PostLinkSharing&lt;/div&gt;</description><link>https://plinksharing.blogspot.com/2021/02/wordpress-tutorials.html</link><author>noreply@blogger.com (Arakkha Sênâ)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1955839799848409424.post-6387928221233774822</guid><pubDate>Mon, 22 Feb 2021 13:10:00 +0000</pubDate><atom:updated>2021-02-22T05:10:17.424-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Vue</category><category domain="http://www.blogger.com/atom/ns#">Web Programs</category><title>Learn Vue Js</title><description>&lt;div class=&quot;mbtTOC&quot;&gt;
    &lt;button onclick=&quot;mbtToggle()&quot;&gt;Contents&lt;/button&gt;
    &lt;ol id=&quot;mbtTOC&quot;&gt;&lt;/ol&gt;
    &lt;/div&gt;
&lt;h1&gt;Overview&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;Vue&lt;/strong&gt;&amp;nbsp;is a JavaScript framework for building user interfaces. Its core part is focused mainly on the view layer and it is very easy to understand. The version of Vue that we are going to use in this tutorial is 2.0.&lt;/p&gt;
&lt;p&gt;As Vue is basically built for frontend development, we are going to deal with lot of HTML, JavaScript and CSS files in the upcoming chapters. To understand the details, let us start with a simple example.&lt;/p&gt;
&lt;p&gt;In this example, we are going to use the development verison of vuejs.&lt;/p&gt;
&lt;h2&gt;Example&lt;/h2&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Introduction&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;intro&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;align&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{ message }}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vue_det &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#intro&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               message&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;My first VueJS Task&#39;&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;Output&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/first_vuejs.jpg&quot; alt=&quot;First VueJS&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This is the first app we have created using VueJS. As seen in the above code, we have included vue.js at the start of the .html file.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;There is a div which is added in the body that prints&amp;nbsp;&lt;strong&gt;&amp;ldquo;My first VueJS Task&amp;rdquo;&lt;/strong&gt;&amp;nbsp;in the browser.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;intro&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;align&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{ message }}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We have also added a message in a interpolation, i.e.&amp;nbsp;&lt;strong&gt;{{}}&lt;/strong&gt;. This interacts with VueJS and prints the data in the browser. To get the value of the message in the DOM, we are creating an instance of vuejs as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vue_det &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#intro&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      message&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;My first VueJS Task&#39;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;In the above code snippet, we are calling Vue instance, which takes the id of the DOM element i.e. e1:&amp;rsquo;#intro&amp;rsquo;, it is the id of the div. There is data with the message which is assigned the value&amp;nbsp;&lt;strong&gt;&amp;lsquo;My first VueJS Task&amp;rsquo;&lt;/strong&gt;. VueJS interacts with DOM and changes the value in the DOM {{message}} with&amp;nbsp;&lt;strong&gt;&amp;rsquo;My first VueJS Task&amp;rsquo;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;If we happen to change the value of the message in the console, the same will be reflected in the browser. For example &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/vuejs_interesting.jpg&quot; alt=&quot;VueJS Interesting&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Console Details&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/vuejs_is_interesting.jpg&quot; alt=&quot;VueJS is Interesting&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In the above console, we have printed the vue_det object, which is an instance of Vue. We are updating the message with&amp;nbsp;&lt;strong&gt;&amp;ldquo;VueJs is interesting&amp;rdquo;&lt;/strong&gt;&amp;nbsp;and the same is changed in the browser immediately as seen in the above screenshot.&lt;/p&gt;
&lt;p&gt;This is just a basic example showing the linking of VueJS with DOM, and how we can manipulate it. In the next few chapters, we will learn about directives, components, conditional loops, etc.&lt;/p&gt;

&lt;h1&gt;Environment Setup&lt;/h1&gt;
&lt;p&gt;There are many ways to install VueJS. Some of the ways on how to carry out the installation are discussed ahead.&lt;/p&gt;
&lt;h2&gt;Using the &amp;lt;script&amp;gt; tag directly in HTML file&lt;/h2&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;vue.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Go to the home site&amp;nbsp;&lt;strong&gt;https://vuejs.org/v2/guide/installation.html&lt;/strong&gt;&amp;nbsp;of VueJS and download the vue.js as per need. There are two versions for use - production version and development version. The development version is not minimized, whereas the production version is minimized as shown in the following screenshot. Development version will help with the warnings and debug mode during the development of the project.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/installation.jpg&quot; alt=&quot;Installation&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Using CDN&lt;/h2&gt;
&lt;p&gt;We can also start using VueJS file from the CDN library. The link&amp;nbsp;&lt;a href=&quot;https://unpkg.com/vue&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://unpkg.com/vue&lt;/a&gt;&amp;nbsp;will give the latest version of VueJS. VueJS is also available on jsDelivr (&lt;a href=&quot;https://cdn.jsdelivr.net/npm/vue/dist/vue.js&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://cdn.jsdelivr.net/npm/vue/dist/vue.js&lt;/a&gt;) and cdnjs (&lt;a href=&quot;https://cdnjs.cloudflare.com/ajax/libs/vue/2.4.0/vue.js&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://cdnjs.cloudflare.com/ajax/libs/vue/2.4.0/vue.js&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;We can host the files at our end, if required and get started with VueJS development.&lt;/p&gt;
&lt;h2&gt;Using NPM&lt;/h2&gt;
&lt;p&gt;For large scale applications with VueJS, it is recommended to install using the npm package. It comes with Browserify and Webpack along with other necessary tools, which help with the development. Following is the command to install using npm.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;npm  install vue
&lt;/pre&gt;
&lt;h2&gt;Using CLI Command Line&lt;/h2&gt;
&lt;p&gt;VueJS also provides CLI to install the vue and get started with the server activation. To install using CLI, we need to have CLI installed which is done using the following command.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;npm install --global vue-cli
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/cli_command_line.jpg&quot; alt=&quot;CLI Command Line&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Once done, it shows the CLI version for VueJS. It takes a few minutes for the installation.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;+ vue-cli@2.8.2
added 965 packages in 355.414s
&lt;/pre&gt;
&lt;p&gt;Following is the command to create the project using Webpack.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;vue init webpack myproject
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/select_command_prompt.jpg&quot; alt=&quot;Select Command Prompt&quot; /&gt;&lt;/p&gt;
&lt;p&gt;To get started, use the following command.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;cd myproject
npm install
npm run dev
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/command_prompt.jpg&quot; alt=&quot;Command Prompt&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/npm.jpg&quot; alt=&quot;NPM&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Once we execute npm run dev, it starts the server and provides the url for display to be seen in the browser which is as shown in the following screenshot.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/welcome_to_vuejs.jpg&quot; alt=&quot;Welcome to VueJS&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The project structure using CLI looks like the following.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/cli.jpg&quot; alt=&quot;CLI&quot; /&gt;&lt;/p&gt;

&lt;h1&gt;Instances&lt;/h1&gt;
&lt;p&gt;To start with VueJS, we need to create the instance of Vue, which is called the&amp;nbsp;&lt;strong&gt;root Vue Instance&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;Syntax&lt;/h2&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;var app = new Vue({
   // options
})
&lt;/pre&gt;
&lt;p&gt;Let us look at an example to understand what needs to be part of the Vue constructor.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;vue_det&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Firstname : {{firstname}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Lastname : {{lastname}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{mydetails()}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue_instance.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;vue_instance.js&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;  vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#vue_det&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      firstname &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Ria&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      lastname  &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Singh&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      address    &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Mumbai&quot;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   methods&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      mydetails &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;I am &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;firstname &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;lastname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;For Vue, there is a parameter called&amp;nbsp;&lt;strong&gt;el&lt;/strong&gt;. It takes the id of the DOM element. In the above example, we have the id&amp;nbsp;&lt;strong&gt;#vue_det&lt;/strong&gt;. It is the id of the div element, which is present in .html.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;vue_det&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Now, whatever we are going to do will affect the div element and nothing outside it.&lt;/p&gt;
&lt;p&gt;Next, we have defined the data object. It has value firstname, lastname, and address.&lt;/p&gt;
&lt;p&gt;The same is assigned inside the div. For example,&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;vue_det&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Firstname : {{firstname}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Lastname : {{lastname}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The Firstname : {{firstname}} value will be replaced inside the interpolation, i.e. {{}} with the value assigned in the data object, i.e. Ria. The same goes for last name.&lt;/p&gt;
&lt;p&gt;Next, we have methods where we have defined a function mydetails and a returning value. It is assigned inside the div as&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{mydetails()}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Hence, inside {{} } the function mydetails is called. The value returned in the Vue instance will be printed inside {{}}. Check the output for reference.&lt;/p&gt;
&lt;h2&gt;Output&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/vue_instance.jpg&quot; alt=&quot;Vue Instance&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now, we need to pass options to the Vue constructor which is mainly data, template, element to mount on, methods, callbacks, etc.&lt;/p&gt;
&lt;p&gt;Let us take a look at the options to be passed to the Vue.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;#data&lt;/strong&gt;&amp;nbsp;&amp;minus; This type of data can be an object or a function. Vue converts its properties to getters/setters to make it reactive.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s take a look at how the data is passed in the options.&lt;/p&gt;
&lt;h2&gt;Example&lt;/h2&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Introduction&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; _obj &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; fname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Raj&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; lname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Singh&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         
         &lt;span class=&quot;com&quot;&gt;// direct instance creation&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; _obj
         &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;vm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;fname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;vm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;vm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;fname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;Output&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/filter.jpg&quot; alt=&quot;Filter&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;console.log(vm.fname);&lt;/strong&gt;&amp;nbsp;// prints Raj&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;console.log(vm.$data);&lt;/strong&gt;&amp;nbsp;prints the full object as shown above&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;console.log(vm.$data.fname);&lt;/strong&gt;&amp;nbsp;// prints Raj&lt;/p&gt;
&lt;p&gt;If there is a component, the data object has to be referred from a function as shown in the following code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Introduction&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; _obj &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; fname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Raj&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; lname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Singh&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;};&lt;/span&gt;
         
         &lt;span class=&quot;com&quot;&gt;// direct instance creation&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; _obj
         &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;vm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;fname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;vm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;vm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;fname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         
         &lt;span class=&quot;com&quot;&gt;// must use function when in Vue.extend()&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Component&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;extend&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; _obj
            &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myComponentInstance &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Component&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;myComponentInstance&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;lname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;myComponentInstance&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;In case of a component, the data is a function, which is used with Vue.extend as shown above. The data is a function. For example,&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; _obj
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;To refer to the data from the component, we need to create an instance of it. For example,&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myComponentInstance &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Component&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;To fetch the details from the data, we need to do the same as we did with the parent component above. For example.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;myComponentInstance&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;lname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;myComponentInstance&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Following are the details displayed in the browser.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/console.jpg&quot; alt=&quot;Console&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Props&lt;/strong&gt;&amp;nbsp;&amp;minus; Type for props is an array of string or object. It takes an array-based or object-based syntax. They are said to be attributes used to accept data from the parent component.&lt;/p&gt;
&lt;h2&gt;Example 1&lt;/h2&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;component&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;props-demo-simple&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   props&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;size&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;myMessage&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;Example 2&lt;/h2&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;component&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;props-demo-advanced&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   props&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;com&quot;&gt;// just type check&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      height&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Number&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
      
      &lt;span class=&quot;com&quot;&gt;// type check plus other validations&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      age&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         type&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Number&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         required&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         validator&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; value &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;propsData&lt;/strong&gt;&amp;nbsp;&amp;minus; This is used for unit testing.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Type&lt;/strong&gt;&amp;nbsp;&amp;minus; array of string. For example, { [key: string]: any }. It needs to be passed during the creation of Vue instance.&lt;/p&gt;
&lt;h2&gt;Example&lt;/h2&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Comp&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;extend&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   props&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;msg&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;],&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;template&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;div&amp;gt;{{ msg }}&amp;lt;/div&amp;gt;&#39;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Comp&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   propsData&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      msg&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;hello&#39;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Computed&lt;/strong&gt;&amp;nbsp;&amp;minus; Type: { [key: string]: Function | { get: Function, set: Function } }&lt;/p&gt;
&lt;h2&gt;Example&lt;/h2&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Introduction&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            computed&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            
               &lt;span class=&quot;com&quot;&gt;// get only, just need a function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               aSum&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
               
               &lt;span class=&quot;com&quot;&gt;// both get and set&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               aSquare&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                  &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;v&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; v&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                  &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;vm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;aSquare&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;  &lt;span class=&quot;com&quot;&gt;// -&amp;gt; 4&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         vm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;aSquare &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;vm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;       &lt;span class=&quot;com&quot;&gt;// -&amp;gt; 6&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;vm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;aSum&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;// -&amp;gt; 8&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Computed has two functions&amp;nbsp;&lt;strong&gt;aSum&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;aSquare&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Function aSum just returns&amp;nbsp;&lt;strong&gt;this.a+2&lt;/strong&gt;. Function aSquare again two functions&amp;nbsp;&lt;strong&gt;get&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;set&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Variable vm is an instance of Vue and it calls aSquare and aSum. Also vm.aSquare = 3 calls the set function from aSquare and vm.aSquare calls the get function. We can check the output in the browser which looks like the following screenshot.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/instance_of_vue.jpg&quot; alt=&quot;Instance of Vue&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Methods&lt;/strong&gt;&amp;nbsp;&amp;minus; Methods are to be included with the Vue instance as shown in the following code. We can access the function using the Vue object.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Introduction&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;5&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               asquare&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;*=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         vm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;asquare&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;vm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;// 25&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Methods are part of the Vue constructor. Let us make a call to the method using the Vue object&amp;nbsp;&lt;strong&gt;vm.asquare ()&lt;/strong&gt;, the value of the property&amp;nbsp;&lt;strong&gt;a&lt;/strong&gt;&amp;nbsp;is updated in the&amp;nbsp;&lt;strong&gt;asquare&lt;/strong&gt;&amp;nbsp;function. The value of a is changed from 1 to 25, and the same is seen reflected in the following browser console.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/asquare_function.jpg&quot; alt=&quot;asquare function&quot; /&gt;&lt;/p&gt;

&lt;h1&gt;Templates&lt;/h1&gt;
&lt;p&gt;We have learnt in the earlier chapters, how to get an output in the form of text content on the screen. In this chapter, we will learn how to get an output in the form of HTML template on the screen.&lt;/p&gt;
&lt;p&gt;To understand this, let us consider an example and see the output in the browser.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;vue_det&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Firstname : {{firstname}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Lastname : {{lastname}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{htmlcontent}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue_template.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;vue_template.js&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#vue_det&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      firstname &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Ria&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      lastname  &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Singh&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      htmlcontent &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;div&amp;gt;&amp;lt;h1&amp;gt;Vue Js Template&amp;lt;/h1&amp;gt;&amp;lt;/div&amp;gt;&quot;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Now, suppose we want to show the html content on the page. If we happen to use it with interpolation, i.e. with double curly brackets, this is what we will get in the browser.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/content.jpg&quot; alt=&quot;Content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;If we see the html content is displayed the same way we have given in the variable htmlcontent, this is not what we want, we want it to be displayed in a proper HTML content on the browser.&lt;/p&gt;
&lt;p&gt;For this, we will have to use&amp;nbsp;&lt;strong&gt;v-html&lt;/strong&gt;&amp;nbsp;directive. The moment we assign v-html directive to the html element, VueJS knows that it has to output it as HTML content. Let&amp;rsquo;s add v-html directive in the&amp;nbsp;&lt;strong&gt;.html&lt;/strong&gt;&amp;nbsp;file and see the difference.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;vue_det&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Firstname : {{firstname}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Lastname : {{lastname}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-html&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;htmlcontent&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue_template.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Now, we don&amp;rsquo;t need the double curly brackets to show the HTML content, instead we have used v-html = &amp;rdquo;htmlcontent&amp;rdquo; where htmlcontent is defined inside the&amp;nbsp;&lt;strong&gt;js&lt;/strong&gt;&amp;nbsp;file as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#vue_det&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      firstname &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Ria&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      lastname  &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Singh&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      htmlcontent &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;div&amp;gt;&amp;lt;h1&amp;gt;Vue Js Template&amp;lt;/h1&amp;gt;&amp;lt;/div&amp;gt;&quot;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The output in the browser is as follows &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/htmlcontent.jpg&quot; alt=&quot;HTMLContent&quot; /&gt;&lt;/p&gt;
&lt;p&gt;If we inspect the browser, we will see the content is added in the same way as it is defined in the&amp;nbsp;&lt;strong&gt;.js&lt;/strong&gt;&amp;nbsp;file to the variable&amp;nbsp;&lt;strong&gt;htmlcontent : &quot;&amp;lt;div&amp;gt;&amp;lt;h1&amp;gt;Vue Js Template&amp;lt;/h1&amp;gt;&amp;lt;/div&amp;gt;&quot;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s take a look at the inspect element in the browser.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/template.jpg&quot; alt=&quot;Template&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We have seen how to add HTML template to the DOM. Now, we will see how to add attributes to the exiting HTML elements.&lt;/p&gt;
&lt;p&gt;Consider, we have an image tag in the HTML file and we want to assign src, which is a part of Vue.&lt;/p&gt;
&lt;h2&gt;Example&lt;/h2&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;vue_det&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Firstname : {{firstname}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Lastname : {{lastname}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-html&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;htmlcontent&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;300&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;height&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;250&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue_template1.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Look at the img tag above, the src is blank. We need to add the src to it from vue js. Let us take a look at how to do it. We will store the img src in the data object in the&amp;nbsp;&lt;strong&gt;.js&lt;/strong&gt;&amp;nbsp;file as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#vue_det&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      firstname &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Ria&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      lastname  &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Singh&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      htmlcontent &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;div&amp;gt;&amp;lt;h1&amp;gt;Vue Js Template&amp;lt;/h1&amp;gt;&amp;lt;/div&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      imgsrc &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;images/img.jpg&quot;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;If we assign the src as follows, the output in the browser will be as shown in the following screenshot.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;{{imgsrc}}&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;300&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;height&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;250&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/imgsrc.jpg&quot; alt=&quot;Imgsrc&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We get a broken image. To assign any attribute to HMTL tag, we need to use&amp;nbsp;&lt;strong&gt;v-bind&lt;/strong&gt;directive. Let&amp;rsquo;s add the src to the image with v-bind directive.&lt;/p&gt;
&lt;p&gt;This is how it is assigned in&amp;nbsp;&lt;strong&gt;.html&lt;/strong&gt;&amp;nbsp;file.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;vue_det&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Firstname : {{firstname}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Lastname : {{lastname}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-html&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;htmlcontent&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;imgsrc&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;300&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;height&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;250&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue_template1.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We need to prefix the src with&amp;nbsp;&lt;strong&gt;v-bind:src = &amp;rdquo;imgsrc&amp;rdquo;&lt;/strong&gt;&amp;nbsp;and the name of the variable with src.&lt;/p&gt;
&lt;p&gt;Following is the output in the browser.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/img_display.jpg&quot; alt=&quot;Img Display&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let us inspect and check how the src looks like with v-bind.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/inspect.jpg&quot; alt=&quot;Inspect&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As seen in the above screenshot, the src is assigned without any vuejs properties to it.&lt;/p&gt;

&lt;h1&gt;Components&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;Vue Components&lt;/strong&gt;&amp;nbsp;are one of the important features of VueJS that creates custom elements, which can be reused in HTML.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s work with an example and create a component, that will give a better understanding on how components work with VueJS.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;component_test&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;testcomponent&amp;gt;&amp;lt;/testcomponent&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;component_test1&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;testcomponent&amp;gt;&amp;lt;/testcomponent&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue_component.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;vue_component.js&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;component&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;testcomponent&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,{&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;template&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;div&amp;gt;&amp;lt;h1&amp;gt;This is coming from component&amp;lt;/h1&amp;gt;&amp;lt;/div&amp;gt;&#39;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#component_test&#39;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm1 &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#component_test1&#39;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;In the .html file, we have created two div with id&amp;nbsp;&lt;strong&gt;component_test&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;component_test1&lt;/strong&gt;. In the&amp;nbsp;&lt;strong&gt;.js&lt;/strong&gt;&amp;nbsp;files shown above, two Vue instances are created with the div ids. We have created a common component to be used with both the view instances.&lt;/p&gt;
&lt;p&gt;To create a component, following is the syntax.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;component&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;nameofthecomponent&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,{&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;// options});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Once a component is created, the name of the component becomes the custom element and the same can be used in the Vue instance element created, i.e. inside the div with ids&amp;nbsp;&lt;strong&gt;component_test&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;component_test1&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;In the&amp;nbsp;&lt;strong&gt;.js&lt;/strong&gt;&amp;nbsp;file, we have used a test component as the name of the component and the same name is used as the custom element inside the divs.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;component_test&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;testcomponent&amp;gt;&amp;lt;/testcomponent&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;component_test1&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;testcomponent&amp;gt;&amp;lt;/testcomponent&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;In the component created in the&amp;nbsp;&lt;strong&gt;.js&lt;/strong&gt;&amp;nbsp;file, we have added a template to which we have assigned a HTML code. This is a way of&amp;nbsp;&lt;strong&gt;registering a global component&lt;/strong&gt;, which can be made a part of any vue instance as shown in the following script.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;component&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;testcomponent&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,{&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;template&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;div&amp;gt;&amp;lt;h1&amp;gt;This is coming from component&amp;lt;/h1&amp;gt;&amp;lt;/div&amp;gt;&#39;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;On execution, the same will be reflected in the browser.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/global_component.jpg&quot; alt=&quot;Global Component&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The components are given the custom element tag, i.e.&amp;nbsp;&lt;strong&gt;&amp;lt;testcomponent&amp;gt;&amp;lt;/testcomponent&amp;gt;&lt;/strong&gt;. However, when we inspect the same in the browser, we will not notice the custom tag in plain HTML present in the template as shown in the following screenshot.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/testcomponent.jpg&quot; alt=&quot;TestComponent&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We have also directly made the components a part of vue instance as shown in the following script.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#component_test&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   components&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:{&lt;/span&gt;
      &lt;span class=&quot;str&quot;&gt;&#39;testcomponent&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;template&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;div&amp;gt;&amp;lt;h1&amp;gt;This is coming from component&amp;lt;/h1&amp;gt;&amp;lt;/div&amp;gt;&#39;&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This is called&amp;nbsp;&lt;strong&gt;local registration&lt;/strong&gt;&amp;nbsp;and the components will be a part of only the vue instance created.&lt;/p&gt;
&lt;p&gt;So far, we have seen the basic component with the basic options. Now, let&amp;rsquo;s add some more options such as data and methods to it. Just as Vue instance has data and methods, component also shares the same. Hence, we will extend the code, which we have already seen with data and methods.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;component_test&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;testcomponent&amp;gt;&amp;lt;/testcomponent&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;component_test1&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;testcomponent&amp;gt;&amp;lt;/testcomponent&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue_component.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;vue_component.js&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;component&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;testcomponent&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,{&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;template&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;div v-on:mouseover = &quot;changename()&quot; v-on:mouseout = &quot;originalname();&quot;&amp;gt;&amp;lt;h1&amp;gt;Custom Component created by &amp;lt;span id = &quot;name&quot;&amp;gt;{{name}}&amp;lt;/span&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;/div&amp;gt;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Ria&quot;&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   methods&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      changename &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Ben&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      originalname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Ria&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#component_test&#39;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm1 &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#component_test1&#39;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;In the&amp;nbsp;&lt;strong&gt;.js&lt;/strong&gt;&amp;nbsp;file above, we have added data that is a function, which returns an object. The object has a name property, which is assigned the value &amp;lsquo;Ria&amp;rsquo;. This is used in the following template.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;template&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;div v-on:mouseover = &quot;changename()&quot; v-on:mouseout = &quot;originalname();&quot;&amp;gt;&amp;lt;h1&amp;gt;Custom Component created by &amp;lt;span id = &quot;name&quot;&amp;gt;{{name}}&amp;lt;/span&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;/div&amp;gt;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;In spite of having data as a function in components, we can use its properties the same way as we use with direct Vue instance. Also, there are two methods added, changename and originalname. In changename, we are changing the name property, and in originalname we are resetting it back to the original name.&lt;/p&gt;
&lt;p&gt;We have also added two events on the div, mouseover and mouseout. The details of the events will be discussed in the Events chapter. So for now, mouseover calls&amp;nbsp;&lt;strong&gt;changename&lt;/strong&gt;method and mouseout calls&amp;nbsp;&lt;strong&gt;originalname&lt;/strong&gt;&amp;nbsp;method.&lt;/p&gt;
&lt;p&gt;The display of the same is shown in the following browser.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/originalname.jpg&quot; alt=&quot;OriginalName&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As seen in the above browser, it displays the name assigned in the data property, which is the same name. We have also assigned a mouseover event on the div and also a mouseout. Let&amp;rsquo;s see what happens when we mouseover and mouseout.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/mouseover.jpg&quot; alt=&quot;Mouseover&quot; /&gt;&lt;/p&gt;
&lt;p&gt;On mouseover, we see the name of the first component is changed to Ben, however, the second one remains as it is. This is because the data component is a function and it returns an object. Thus, when it is changed in one place, the same is not overwritten in other cases.&lt;/p&gt;
&lt;h2&gt;Dynamic Components&lt;/h2&gt;
&lt;p&gt;Dynamic components are created using the keyword&amp;nbsp;&lt;strong&gt;&amp;lt;component&amp;gt;&amp;lt;/component&amp;gt;&lt;/strong&gt;&amp;nbsp;and it is bound using a property as shown in the following example.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;databinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;component&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:is&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;view&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/component&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#databinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               view&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;component1&#39;&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            components&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
               &lt;span class=&quot;str&quot;&gt;&#39;component1&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  template&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;div&amp;gt;&amp;lt;span style = &quot;font-size:25;color:red;&quot;&amp;gt;Dynamic Component&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&#39;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/dynamic_component.jpg&quot; alt=&quot;Dynamic Component&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Dynamic component is created using the following syntax.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;component&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:is&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;view&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/component&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;It has v-bind:is = &amp;rdquo;view&amp;rdquo;, and a value view is assigned to it. View is defined in the Vue instance as follows.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#databinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      view&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;component1&#39;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   components&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;str&quot;&gt;&#39;component1&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;template&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;div&amp;gt;&amp;lt;span style = &quot;font-size:25;color:red;&quot;&amp;gt;Dynamic Component&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&#39;&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;When executed, the template&amp;nbsp;&lt;strong&gt;Dynamic Component&lt;/strong&gt;&amp;nbsp;is displayed in the browser.&lt;/p&gt;

&lt;h1&gt;Computed Properties&lt;/h1&gt;
&lt;p&gt;We have already seen methods for Vue instance and for components. Computed properties are like methods but with some difference in comparison to methods, which we will discuss in this chapter.&lt;/p&gt;
&lt;p&gt;At the end of this chapter, we will be able to make a decision on when to use methods and when to use computed properties.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s understand computed properties using an example.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;computed_props&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         FirstName : &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-model&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;firstname&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         LastName : &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-model&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;lastname&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;My name is {{firstname}} {{lastname}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Using computed method : {{getfullname}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue_computedprops.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;vue_computeprops.js&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#computed_props&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      firstname &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      lastname &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      birthyear &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&quot;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   computed &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      getfullname &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(){&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;firstname &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;lastname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Here, we have created&amp;nbsp;&lt;strong&gt;.html&lt;/strong&gt;&amp;nbsp;file with firstname and lastname. Firstname and Lastname is a textbox which are bound using properties firstname and lastname.&lt;/p&gt;
&lt;p&gt;We are calling the computed method getfullname, which returns the firstname and the lastname entered.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;computed &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   getfullname &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(){&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;firstname &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;lastname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;When we type in the textbox the same is returned by the function, when the properties firstname or lastname is changed. Thus, with the help of computed we don&amp;rsquo;t have to do anything specific, such as remembering to call a function. With computed it gets called by itself, as the properties used inside changes, i.e. firstname and lastname.&lt;/p&gt;
&lt;p&gt;The same is displayed in the following browser. Type in the textbox and the same will get updated using the computed function.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/text_box.jpg&quot; alt=&quot;Text Box&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now, let&amp;rsquo;s try to understand the difference between a method and a computed property. Both are objects. There are functions defined inside, which returns a value.&lt;/p&gt;
&lt;p&gt;In case of method, we call it as a function, and for computed as a property. Using the following example, let us understand the difference between method and computed property.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;computed_props&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;gray&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Random No from computed property: {{getrandomno}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Random No from method: {{getrandomno1()}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Random No from method : {{getrandomno1()}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&lt;/span&gt;  &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;gray&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Random No from computed property: {{getrandomno}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&lt;/span&gt;  &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;gray&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Random No from computed property: {{getrandomno}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&lt;/span&gt;  &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;gray&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Random No from computed
            property: {{getrandomno}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Random No from method: {{getrandomno1()}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Random No from method: {{getrandomno1()}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#computed_props&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;helloworld&quot;&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               getrandomno1 &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Math&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;random&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            computed &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               getrandomno &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(){&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Math&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;random&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;In the above code, we have created a method called&amp;nbsp;&lt;strong&gt;getrandomno1&lt;/strong&gt;&amp;nbsp;and a computed property with a function&amp;nbsp;&lt;strong&gt;getrandomno&lt;/strong&gt;. Both are giving back random numbers using Math.random().&lt;/p&gt;
&lt;p&gt;It is displayed in the browser as shown below. The method and computed property are called many times to show the difference.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/getrandomno.jpg&quot; alt=&quot;Getrandomno&quot; /&gt;&lt;/p&gt;
&lt;p&gt;If we look at the values above, we will see that the random numbers returned from the computed property remains the same irrespective of the number of times it is called. This means everytime it is called, the last value is updated for all. Whereas for a method, it&amp;rsquo;s a function, hence, everytime it is called it returns a different value.&lt;/p&gt;
&lt;h2&gt;Get/Set in Computed Properties&lt;/h2&gt;
&lt;p&gt;In this section, we will learn about get/set functions in computed properties using an example.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;computed_props&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-model&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;fullname&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{firstName}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{lastName}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#computed_props&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               firstName &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Terry&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               lastName &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Ben&quot;&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            computed &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               fullname &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;get&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;firstName&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;lastName&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                  &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We have defined one input box which is bound to&amp;nbsp;&lt;strong&gt;fullname&lt;/strong&gt;, which is a computed property. It returns a function called&amp;nbsp;&lt;strong&gt;get&lt;/strong&gt;, which gives the fullname, i.e. the first name and the lastname. Also, we have displayed the firstname and lastname as &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{firstName}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{lastName}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Let&amp;rsquo;s check the same in the browser.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/get.jpg&quot; alt=&quot;Get&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now, if we change the name in the textbox, we will see the same is not reflected in the name displayed in the following screenshot.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/name_in_textbox.jpg&quot; alt=&quot;Name in TextBox&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s add the setter function in the fullname computed property.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;computed_props&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-model&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;fullname&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{firstName}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{lastName}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#computed_props&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               firstName &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Terry&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               lastName &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Ben&quot;&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            computed &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               fullname &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;get&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;firstName&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;lastName&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                  &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; fname &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;firstName &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; fname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;];&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;lastName &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; fname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;
                  &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We have added the set function in the fullname computed property.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;computed &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   fullname &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;get&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;firstName&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;lastName&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; fname &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;firstName &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; fname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;];&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;lastName &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; fname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;It has the name as the parameter, which is nothing but the fullname in the textbox. Later, it is split on space and the firstname and the lastname is updated. Now, when we run the code and edit the textbox, the same thing will be displayed in the browser. The firstname and the lastname will be updated because of the set function. The get function returns the firstname and lastname, while the set function updates it, if anything is edited.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/name_in_text_box.jpg&quot; alt=&quot;Name in Text Box&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now, whatever is typed in the textbox matches with what is displayed as seen in the above screenshot.&lt;/p&gt;

&lt;h1&gt;Watch Property&lt;/h1&gt;
&lt;p&gt;In this chapter, we will learn about the Watch property. Using an example, we will see we can use the Watch property in VueJS.&lt;/p&gt;
&lt;h2&gt;Example&lt;/h2&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;computed_props&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         Kilometers : &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-model&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;kilometers&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         Meters : &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-model&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;meters&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#computed_props&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               kilometers &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               meters&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            computed &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:{&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            watch &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               kilometers&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;kilometers &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; val&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;meters &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; val &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               meters &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;kilometers &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; val&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;meters &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; val&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;In the above code, we have created two textboxes, one with&amp;nbsp;&lt;strong&gt;kilometers&lt;/strong&gt;&amp;nbsp;and another with&amp;nbsp;&lt;strong&gt;meters&lt;/strong&gt;. In data property, the kilometers and meters are initialized to 0. There is a watch object created with two functions&amp;nbsp;&lt;strong&gt;kilometers&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;meters&lt;/strong&gt;. In both the functions, the conversion from kilometers to meters and from meters to kilometers is done.&lt;/p&gt;
&lt;p&gt;As we enter values inside any of the texboxes, whichever is changed, Watch takes care of updating both the textboxes. We do not have to specially assign any events and wait for it to change and do the extra work of validating. Watch takes care of updating the textboxes with the calculation done in the respective functions.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s take a look at the output in the browser.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/textbox.jpg&quot; alt=&quot;TextBox&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s enter some values in the kilometers textbox and see it changing in the meters textbox and vice-versa.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/textbox_changes.jpg&quot; alt=&quot;TextBox Changes&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s now enter in meters textbox and see it changing in the kilometers textbox. This is the display seen in the browser.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/watch.jpg&quot; alt=&quot;Watch&quot; /&gt;&lt;/p&gt;

&lt;h1&gt;Binding&lt;/h1&gt;
&lt;p&gt;In this chapter will learn how to manipulate or assign values to HTML attributes, change the style, and assign classes with the help of binding directive called&amp;nbsp;&lt;strong&gt;v-bind&lt;/strong&gt;&amp;nbsp;available with VueJS.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s consider an example to understand why we need and when to use v-bind directive for data binding.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;databinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         {{title}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;br/&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;hreflink&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;target&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;_blank&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Click Me &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;&amp;lt;br/&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;{{hreflink}}&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;target&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;_blank&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click Me &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;  &lt;span class=&quot;tag&quot;&gt;&amp;lt;br/&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;hreflink&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;target&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;_blank&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click Me &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;   &lt;span class=&quot;tag&quot;&gt;&amp;lt;br/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#databinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               title &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;DATA BINDING&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               hreflink &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;http://www.google.com&quot;&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;In above example, we have displayed a title variable and three anchor links. We have also assigned a value to the href from the data object.&lt;/p&gt;
&lt;p&gt;Now, if we check the output in the browser and inspect, we will see the first two anchor links do not have the href correctly as shown in the following screenshot.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/anchor_tag.jpg&quot; alt=&quot;Anchor Tag&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The first clickme shows the href as hreflink, and the second one shows it in {{hreflink}}, while the last one displays the correct url as we require.&lt;/p&gt;
&lt;p&gt;Hence, to assign values to HTML attributes, we need to bind it with the directive v-bind as follows.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;hreflink&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;target&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;_blank&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click Me &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;VueJS also provides a shorthand for v-bind as follows.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;hreflink&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;target&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;_blank&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click Me &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;If we see the inspect element in the browser, the anchor tag does not show the v-bind attribute, however, it displays the plain HTML. None of the VueJS properties are seen when we inpsect the DOM.&lt;/p&gt;
&lt;h2&gt;Binding HTML Classes&lt;/h2&gt;
&lt;p&gt;To bind HTML class, we need to use&amp;nbsp;&lt;strong&gt;v-bind: class&lt;/strong&gt;. Let&amp;rsquo;s consider an example and bind classes in it.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;active &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; red&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;classbinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;{active:isactive}&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;b&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{title}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/b&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#classbinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               title &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;CLASS BINDING&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               isactive &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;There is a div created with v-bind: class=&amp;rdquo; {active: isactive}&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;Here,&amp;nbsp;&lt;strong&gt;isactive&lt;/strong&gt;&amp;nbsp;is a variable which is based on true or false. It will apply the class active to the div. In the data object, we have assigned the isactive variable as true. There is a class defined in the style&amp;nbsp;&lt;strong&gt;.active&lt;/strong&gt;&amp;nbsp;with the background color as red.&lt;/p&gt;
&lt;p&gt;If the variable isactive is true, the color will be applied otherwise not. Following will be the output in the browser.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/class_binding.jpg&quot; alt=&quot;Class Binding&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In above display, we can see the background color is red. The class = &amp;rdquo;active&amp;rdquo; is applied to the div.&lt;/p&gt;
&lt;p&gt;Now, let&amp;rsquo;s change the value of the variable to false and see the output. The variable isactive is changed to false as shown in the following code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;active &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; red&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;classbinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;{active:isactive}&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;b&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{title}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/b&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#classbinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               title &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;CLASS BINDING&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               isactive &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;false&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/id_class_binding.jpg&quot; alt=&quot;ID Class Binding&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In the above display, we can see the active class is not applied to the div.&lt;/p&gt;
&lt;p&gt;We can also assign multiple classes to the HTML tags using v-bind attribute.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;info &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#00529B;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#BDE5F8;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         div &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            margin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;10px&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            padding&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;12px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;active &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#4F8A10;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#DFF2BF;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;displayError&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#D8000C;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#FFBABA;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;classbinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;info&quot;&lt;/span&gt;  &lt;span class=&quot;atn&quot;&gt;v-bind:class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;{ active: isActive, &#39;displayError&#39;: hasError }&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            {{title}}
         &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#classbinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               title &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;This is class binding example&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               isActive &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               hasError &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;false&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;For the div in the above code, we have applied a normal class, example class = &amp;rdquo;info&amp;rdquo;. Based on isActive and hasError variable, the other classes will get applied to the div.&lt;/p&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/info.jpg&quot; alt=&quot;Info&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This is a normal class applied. Both the variables are false right now. Let&amp;rsquo;s make&amp;nbsp;&lt;strong&gt;isActive&lt;/strong&gt;variable to true and see the output.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/isactive.jpg&quot; alt=&quot;isActive&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In the above display, in the DOM we can see two classes assigned to the div, info and active. Let&amp;rsquo;s make hasError variable true and isActive as false.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/dom.jpg&quot; alt=&quot;Dom&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now, when we see in the above display, info and displayError class is applied to the div. This is how we can apply multiple classes based on conditions.&lt;/p&gt;
&lt;p&gt;We can also pass class as an array. Let us take an example to understand this.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;info &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#00529B;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#BDE5F8;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         div &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            margin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;10px&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            padding&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;12px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;active &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#4F8A10;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#DFF2BF;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;displayError&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#D8000C;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#FFBABA;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;classbinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;[infoclass, errorclass]&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{title}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#classbinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               title &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;This is class binding example&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               infoclass &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;info&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               errorclass &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;displayError&#39;&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/displayerror.jpg&quot; alt=&quot;displayError&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As we can see above, both classes get applied to the div. Let&amp;rsquo;s use a variable and based on the value of the variable, assign the class.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;info &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#00529B;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#BDE5F8;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         div &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            margin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;10px&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            padding&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;12px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;active &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#4F8A10;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#DFF2BF;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;displayError&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#D8000C;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#FFBABA;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;classbinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;[isActive ? infoclass : &#39;&#39;, haserror ? errorclass : &#39;&#39;]&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{title}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#classbinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               title &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;This is class binding example&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               infoclass &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;info&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               errorclass &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;displayError&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               isActive &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               haserror &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;false&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We have used two variables&amp;nbsp;&lt;strong&gt;isActive&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;haserror&lt;/strong&gt;&amp;nbsp;and the same is used for the div while class binding as shown in the following div tag.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;[isActive ? infoclass : &#39;&#39;, haserror ? errorclass : &#39;&#39;]&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{title}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;If isActive is true, then infoclass will be assigned to it. The same goes for haserror, if it is true, then only errorClass will be applied to it.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/Haserror.jpg&quot; alt=&quot;haserror&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now, let us make haserror variable as true and isActive variable as false.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/isactive_variable.jpg&quot; alt=&quot;isActive variable&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We will now add v-bind for classes in the components. In the following example, we have added a class to the component template and also to the component.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;info &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#00529B;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#BDE5F8;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         div &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            margin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;10px&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            padding&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;12px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;active &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#4F8A10;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#DFF2BF;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;displayError&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#D8000C;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#FFBABA;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;classbinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;new_component&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;active&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/new_component&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#classbinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               title &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;This is class binding example&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               infoclass &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;info&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               errorclass &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;displayError&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               isActive &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               haserror &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            components&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:{&lt;/span&gt;
               &lt;span class=&quot;str&quot;&gt;&#39;new_component&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  template &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;div class = &quot;info&quot;&amp;gt;Class Binding for component&amp;lt;/div&amp;gt;&#39;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Following is the output in the browser. It applies both the classes to final div.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&amp;rdquo;info&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;active&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&amp;rdquo;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/final_div.jpg&quot; alt=&quot;Final div&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Add a variable in the component section to display, based on true/false.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;info &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#00529B;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#BDE5F8;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         div &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            margin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;10px&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            padding&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;12px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;active &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#4F8A10;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#DFF2BF;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;displayError&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#D8000C;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#FFBABA;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;classbinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;new_component&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;{active:isActive}&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/new_component&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#classbinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               title &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;This is class binding example&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               infoclass &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;info&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               errorclass &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;displayError&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               isActive &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               haserror &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            components&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:{&lt;/span&gt;
               &lt;span class=&quot;str&quot;&gt;&#39;new_component&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  template &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;div class = &quot;info&quot;&amp;gt;Class Binding for component&amp;lt;/div&amp;gt;&#39;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Since the variable is false, the active class is not applied and the info class is applied as shown in the following screenshot.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/class_applied.jpg&quot; alt=&quot;Class Applied&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Binding Inline Styles&lt;/h2&gt;
&lt;h3&gt;Object Syntax&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;databinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;{ color: activeColor, fontSize: fontSize + &#39;px&#39; }&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{title}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#databinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               title &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Inline style Binding&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               activeColor&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;red&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               fontSize &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;30&#39;&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/inline_style_binding.jpg&quot; alt=&quot;Inline Style Binding&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In the above example, for the div, the style is applied and the data is fetched from the data object.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;{ color: activeColor, fontSize: fontSize + &#39;px&#39; }&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{title}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
data: {
   title : &quot;Inline style Binding&quot;,
   activeColor: &#39;red&#39;,
   fontSize :&#39;30&#39;
}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We can also do the same thing by assigning all the values to a variable and then assigning the variable to the div.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;databinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;styleobj&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{title}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#databinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               title &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Inline style Binding&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               styleobj &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;red&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  fontSize &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;40px&#39;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The color and the fontSize is assigned to the object called styleobj and the same is assigned to the div.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;styleobj&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{title}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/color_inline_style_binding.jpg&quot; alt=&quot;Color Inline Style Binding&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Form Input Bindings&lt;/h2&gt;
&lt;p&gt;So far in the example we have created, we have seen v-model binding the input text element and the value binded to a variable assigned. Let&amp;rsquo;s learn more about it in this section.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;databinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;TEXTBOX&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt;  &lt;span class=&quot;atn&quot;&gt;v-model&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;name&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;placeholder&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Enter Name&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Name entered is : {{name}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;hr/&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Textarea&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;textarea&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-model&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;textmessage&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;placeholder&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Add Details&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/textarea&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{textmessage}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;hr/&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Checkbox&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;checkbox&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;checkbox&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-model&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;checked&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; {{checked}}
      &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#databinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               textmessage&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               checked &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;false&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Whatever we type in the texbox is displayed below. v-model is assigned the value name and the name is displayed in {{name}}, which displays whatever is typed in the textbox.&lt;/p&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/form_input_binding.jpg&quot; alt=&quot;Form Input Binding&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s checkout out some more examples and how to use it.&lt;/p&gt;
&lt;h3&gt;Radio and Select&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;databinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Radio&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;radio&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;black&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Black&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-model&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;picked&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Black
         &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;radio&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;white&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;White&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-model&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;picked&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;White
         &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Radio element clicked : {{picked}} &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;hr/&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Select&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;select&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-model&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;languages&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;option&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;disabled&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Please select one&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/option&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;option&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Java&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/option&amp;gt;&lt;/span&gt;

&lt;h1&gt;Events&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;v-on&lt;/strong&gt;&amp;nbsp;is the attribute added to the DOM elements to listen to the events in VueJS.&lt;/p&gt;
&lt;h2&gt;Click Event&lt;/h2&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;databinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-on:click&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;displaynumbers&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click ME&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Add Number 100 + 200 = {{total}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#databinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               num1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               num2 &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               total &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               displaynumbers &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;total &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;  &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;num1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;num2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/event.jpg&quot; alt=&quot;Event&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The following code is used to assign a click event for the DOM element.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-on:click&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;displaynumbers&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click ME&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;There is a shorthand for v-on, which means we can also call the event as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; @&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;click&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;displaynumbers&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click ME&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;On the click of the button, it will call the method &amp;lsquo;displaynumbers&amp;rsquo;, which takes in the event and we have consoled the same in the browser as shown above.&lt;/p&gt;
&lt;p&gt;We will now check one more event mouseover mouseout.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;databinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;styleobj&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-on:mouseover&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;changebgcolor&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-on:mouseout&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;originalcolor&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#databinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               num1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               num2 &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               total &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               styleobj &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;100px&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  height&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;100px&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  backgroundColor&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;red&quot;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               changebgcolor &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;styleobj&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;backgroundColor &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;green&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               originalcolor &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;styleobj&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;backgroundColor &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;red&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;In the above example, we have created a div with width and height as 100px. It has been given a background color red. On mouseover, we are changing the color to green, and on mouseout we are changing the color back to red.&lt;/p&gt;
&lt;p&gt;Hence, during mouseover, a method is called&amp;nbsp;&lt;strong&gt;changebgcolor&lt;/strong&gt;&amp;nbsp;and once we move the mouse out of the div, a method is called&amp;nbsp;&lt;strong&gt;originalcolor&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;This is done as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;styleobj&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-on:mouseover&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;changebgcolor&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-on:mouseout&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;originalcolor&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Two events - mouseover and mouseout - is assigned to the div as shown above. We have created a styleobj variable and given the required style to be assigned to the div. The same variable is binded to the div using v-bind:style = &amp;rdquo;styleobj&amp;rdquo;&lt;/p&gt;
&lt;p&gt;In changebgcolor, we are changing the color to green using the following code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;changebgcolor &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;styleobj&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;backgroundColor &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;green&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Using the stylobj variable, we are changing the color to green.&lt;/p&gt;
&lt;p&gt;Similarly, the following code is used to change it back to the original color.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;originalcolor &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;styleobj&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;backgroundColor &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;red&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This is what we see in the browser.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/color_red.jpg&quot; alt=&quot;Color Red&quot; /&gt;&lt;/p&gt;
&lt;p&gt;When we mouseover, the color will change to green as shown in the following screenshot.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/color_green.jpg&quot; alt=&quot;Color Green&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Event Modifiers&lt;/h2&gt;
&lt;p&gt;Vue has event modifiers available on v-on attribute. Following are the modifiers available &amp;minus;&lt;/p&gt;
&lt;h3&gt;.once&lt;/h3&gt;
&lt;p&gt;Allows the event to execute only once.&lt;/p&gt;
&lt;h3&gt;Syntax&lt;/h3&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&amp;lt;button v-on:click.once = &quot;buttonclicked&quot;&amp;gt;Click Once&amp;lt;/button&amp;gt;
&lt;/pre&gt;
&lt;p&gt;We need to add dot operator while calling the modifiers as shown in the syntax above. Let us use it in an example and understand the working of the once modifier.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;databinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-on:click&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;once&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;buttonclickedonce&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;styleobj&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click Once&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         Output:{{clicknum}}
         &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-on:click&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;buttonclicked&quot;&lt;/span&gt;  &lt;span class=&quot;atn&quot;&gt;v-bind:style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;styleobj&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click Me&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         Output:{{clicknum1}}
      &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#databinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               clicknum &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               clicknum1 &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               styleobj&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  backgroundColor&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#2196F3!important&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  cursor&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;pointer&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  padding&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;8px 16px&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  verticalAlign&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;middle&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               buttonclickedonce &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;clicknum&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;++;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               buttonclicked &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;clicknum1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;++;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/event_modifier.jpg&quot; alt=&quot;Event Modifier&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In the above example, we have created two butttons. The button with Click Once label has added the once modifier and the other button is without any modifier. This is the way the buttons are defined.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-on:click&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;once&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;buttonclickedonce&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;styleobj&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click Once&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-on:click&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;buttonclicked&quot;&lt;/span&gt;  &lt;span class=&quot;atn&quot;&gt;v-bind:style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;styleobj&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click Me&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The first button calls the method &amp;ldquo;buttonclickedonce&amp;rdquo; and the second button calls the method &amp;ldquo;buttonclicked&amp;rdquo;.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;buttonclickedonce &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;clicknum&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;++;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
buttonclicked &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;clicknum1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;++;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;There are two variables defined in the clicknum and clicknum1. Both are incremented when the button is clicked. Both the variables are initialized to 0 and the display is seen in the output above.&lt;/p&gt;
&lt;p&gt;On the click of the first button, the variable clicknum increments by 1. On the second click, the number is not incremented as the modifier prevents it from executing or performing any action item assigned on the click of the button.&lt;/p&gt;
&lt;p&gt;On the click of the second button, the same action is carried out, i.e. the variable is incremented. On every click, the value is incremented and displayed.&lt;/p&gt;
&lt;p&gt;Following is the output we get in the browser.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/prevent.jpg&quot; alt=&quot;Prevent&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;.prevent&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&amp;lt;a href = &quot;http://www.google.com&quot; v-on:click.prevent = &quot;clickme&quot;&amp;gt;Click Me&amp;lt;/a&amp;gt;
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;databinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;http://www.google.com&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-on:click&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;clickme&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;target&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;_blank&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;styleobj&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click Me&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#databinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               clicknum &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               clicknum1 &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               styleobj&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#4CAF50&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  marginLeft&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;20px&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  fontSize&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;30px&#39;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               clickme &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Anchor tag is clicked&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/click_me.jpg&quot; alt=&quot;Click Me&quot; /&gt;&lt;/p&gt;
&lt;p&gt;If we click the clickme link, it will send an alert as &amp;ldquo;Anchor tag is clicked&amp;rdquo; and it will open the link&amp;nbsp;&lt;a href=&quot;https://www.google.com/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://www.google.com&lt;/a&gt;&amp;nbsp;in a new tab as shown in the following screenshots.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/tag_clicked.jpg&quot; alt=&quot;Tag Clicked&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/tag_opened.jpg&quot; alt=&quot;Tag Opened&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now this works as a normal way, i.e. the link opens up as we want. In case we don&amp;rsquo;t want the link to open up, we need to add a modifier &amp;lsquo;prevent&amp;rsquo; to the event as shown in the following code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;http://www.google.com&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-on:click&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;prevent&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;clickme&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;target&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;_blank&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;styleobj&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click Me&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Once added, if we click on the button, it will send an alert message and will not open the link anymore. The prevent modifier prevents the link from opening and only executes the method assigned to the tag.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;databinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;http://www.google.com&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-on:click&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;prevent&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;clickme&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;target&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;_blank&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;styleobj&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click Me&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#databinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               clicknum &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               clicknum1 &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               styleobj&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#4CAF50&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  marginLeft&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;20px&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  fontSize&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;30px&#39;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               clickme &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Anchor tag is clicked&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/message.jpg&quot; alt=&quot;Message&quot; /&gt;&lt;/p&gt;
&lt;p&gt;On the click of the link, it will display the alert message and does not open the url anymore.&lt;/p&gt;
&lt;h2&gt;Event - Key Modifiers&lt;/h2&gt;
&lt;p&gt;VueJS offers key modifiers based on which we can control the event handling. Consider we have a textbox and we want the method to be called only when we press Enter. We can do so by adding key modifiers to the events as follows.&lt;/p&gt;
&lt;h3&gt;Syntax&lt;/h3&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&amp;lt;input type = &quot;text&quot;  v-on:keyup.enter = &quot;showinputvalue&quot;/&amp;gt;
&lt;/pre&gt;
&lt;p&gt;The key that we want to apply to our event is&amp;nbsp;&lt;strong&gt;V-on.eventname.keyname&lt;/strong&gt;&amp;nbsp;(as shown above)&lt;/p&gt;
&lt;p&gt;We can make use of multiple keynames. For example,&amp;nbsp;&lt;strong&gt;V-on.keyup.ctrl.enter&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;databinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-on:keyup&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;enter&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;showinputvalue&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;styleobj&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;placeholder&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Enter your name&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; {{name}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#databinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               styleobj&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;30%&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  padding&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;12px 20px&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  margin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;8px 0&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  boxSizing&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;border-box&quot;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               showinputvalue &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;target&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/multiple_keynames.jpg&quot; alt=&quot;Multiple Keynames&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Type something in the textbox and we will see it is displayed only when we press Enter.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/type_text.jpg&quot; alt=&quot;Type Text&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Custom Events&lt;/h2&gt;
&lt;p&gt;Parent can pass data to its component using the prop attribute, however, we need to tell the parent when there are changes in the child component. For this, we can use custom events.&lt;/p&gt;
&lt;p&gt;The parent component can listen to the child component event using&amp;nbsp;&lt;strong&gt;v-on&lt;/strong&gt;&amp;nbsp;attribute.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;databinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;counter-event-example&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Language displayed : &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;b&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{ languageclicked }}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;button-counter&lt;/span&gt;
            &lt;span class=&quot;atn&quot;&gt;v-for&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;(item, index) in languages&quot;&lt;/span&gt;
            &lt;span class=&quot;atn&quot;&gt;v-bind:item&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;item&quot;&lt;/span&gt;
            &lt;span class=&quot;atn&quot;&gt;v-bind:index&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;index&quot;&lt;/span&gt;
            &lt;span class=&quot;atn&quot;&gt;v-on:showlanguage&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;languagedisp&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/button-counter&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;component&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;button-counter&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            template&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;button v-on:click = &quot;displayLanguage(item)&quot;&amp;gt;&amp;lt;span style = &quot;font-size:25px;&quot;&amp;gt;{{ item }}&amp;lt;/span&amp;gt;&amp;lt;/button&amp;gt;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  counter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            props&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;item&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               displayLanguage&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;lng&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;lng&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$emit&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;showlanguage&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; lng&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#databinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               languageclicked&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               languages &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Java&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;PHP&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;C++&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;C&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Javascript&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;C#&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Python&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;HTML&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               languagedisp&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;languageclicked &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/custom_event.jpg&quot; alt=&quot;Custom Event&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The above code shows the data transfer between the parent component and the child component.&lt;/p&gt;
&lt;p&gt;The component is created using the following code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;button-counter&lt;/span&gt;
   &lt;span class=&quot;atn&quot;&gt;v-for&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;(item, index) in languages&quot;&lt;/span&gt;
   &lt;span class=&quot;atn&quot;&gt;v-bind:item&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;item&quot;&lt;/span&gt;
   &lt;span class=&quot;atn&quot;&gt;v-bind:index&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;index&quot;&lt;/span&gt;
   &lt;span class=&quot;atn&quot;&gt;v-on:showlanguage&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;languagedisp&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/button-counter&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;There is a&amp;nbsp;&lt;strong&gt;v-for&lt;/strong&gt;&amp;nbsp;attribute, which will loop with the languages array. The array has a list of languages in it. We need to send the details to the child component. The values of the array are stored in the item and the index.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;v&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;bind&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;item &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;item&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
v&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;bind&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;index &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;index&quot;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;To refer to the values of the array, we need to bind it first to a variable and the varaiable is referred using props property as follows.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;component&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;button-counter&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;template&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;button v-on:click = &quot;displayLanguage(item)&quot;&amp;gt;&amp;lt;span style = &quot;font-size:25px;&quot;&amp;gt;{{ item }}&amp;lt;/span&amp;gt;&amp;lt;/button&amp;gt;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         counter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   props&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;item&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   methods&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      displayLanguage&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;lng&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;lng&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$emit&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;showlanguage&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; lng&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The props property contains the item in an array form. We can also refer to the index as &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;props&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:[&amp;lsquo;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;rsquo;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;&amp;lsquo;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;rsquo;]&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;There is also an event added to the component as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;button-counter&lt;/span&gt;
   &lt;span class=&quot;atn&quot;&gt;v-for&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;(item, index) in languages&quot;&lt;/span&gt;
   &lt;span class=&quot;atn&quot;&gt;v-bind:item&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;item&quot;&lt;/span&gt;
   &lt;span class=&quot;atn&quot;&gt;v-bind:index&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;index&quot;&lt;/span&gt;
   &lt;span class=&quot;atn&quot;&gt;v-on:showlanguage&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;languagedisp&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/button-counter&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The name of the event is&amp;nbsp;&lt;strong&gt;showlanguage&lt;/strong&gt;&amp;nbsp;and it calls a method called&amp;nbsp;&lt;strong&gt;languagedisp&lt;/strong&gt;which is defined in the Vue instance.&lt;/p&gt;
&lt;p&gt;In the component, the template is defined as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;template&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;button v-on:click = &quot;displayLanguage(item)&quot;&amp;gt;&amp;lt;span style = &quot;font-size:25px;&quot;&amp;gt;{{ item }}&amp;lt;/span&amp;gt;&amp;lt;/button&amp;gt;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;There is a button created. The button will get created with as many count in the language array. On the click of the button, there is a method called displayLanguage and the button clicked item is passed as a param to the function. Now the component needs to send the clicked element to the parent component for display which is done as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;component&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;button-counter&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;template&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;button v-on:click = &quot;displayLanguage(item)&quot;&amp;gt;&amp;lt;span style = &quot;font-size:25px;&quot;&amp;gt;{{ item }}&amp;lt;/span&amp;gt;&amp;lt;/button&amp;gt;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         counter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   props&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;item&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   methods&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      displayLanguage&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;lng&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;lng&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$emit&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;showlanguage&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; lng&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The method&amp;nbsp;&lt;strong&gt;displayLanguage&lt;/strong&gt;&amp;nbsp;calls&amp;nbsp;&lt;strong&gt;this.$emit(&amp;lsquo;showlanguage&amp;rsquo;, lng);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;$emit&lt;/strong&gt;&amp;nbsp;is used to call the parent component method. The method showlanguage is the event name given on the component with v-on.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;button-counter&lt;/span&gt;
   &lt;span class=&quot;atn&quot;&gt;v-for&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;(item, index) in languages&quot;&lt;/span&gt;
   &lt;span class=&quot;atn&quot;&gt;v-bind:item&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;item&quot;&lt;/span&gt;
   &lt;span class=&quot;atn&quot;&gt;v-bind:index&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;index&quot;&lt;/span&gt;
   &lt;span class=&quot;atn&quot;&gt;v-on:showlanguage&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;languagedisp&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/button-counter&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We are passing a parameter, i.e. the name of the language clicked to the method of the main parent Vue instance which is defined as follows.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#databinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      languageclicked&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      languages &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Java&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;PHP&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;C++&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;C&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Javascript&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;C#&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Python&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;HTML&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   methods&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      languagedisp&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;languageclicked &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Here, the emit triggers showlanguage which in turn calls&amp;nbsp;&lt;strong&gt;languagedisp&lt;/strong&gt;&amp;nbsp;from the Vue instance methods. It assigns the language clicked value to the variable&amp;nbsp;&lt;strong&gt;languageclicked&lt;/strong&gt;and the same is displayed in the browser as shown in the following screenshot.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Language displayed : &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;b&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{ languageclicked }}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;h1&gt;Rendering&lt;/h1&gt;
&lt;p&gt;In this chapter, we will learn about conditional rendering and list rendering. In conditional rendering, we will discuss about using if, if-else, if-else-if, show, etc. In list rendering, we will discuss how to use for loop.&lt;/p&gt;
&lt;h2&gt;Conditional Rendering&lt;/h2&gt;
&lt;p&gt;Let&amp;rsquo;s get started and work on a example first to explain the details for conditional rendering. With conditional rendering, we want to output only when the condition is met and the conditional check is done with the help of if, if-else, if-else-if, show, etc.&lt;/p&gt;
&lt;h3&gt;v-if&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;databinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-on:click&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;showdata&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;styleobj&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click Me&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;b&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{show}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;show&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is h1 tag&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is h2 tag&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#databinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               show&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               styleobj&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  backgroundColor&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#2196F3!important&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  cursor&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;pointer&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  padding&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;8px 16px&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  verticalAlign&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;middle&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               showdata &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;show &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;show&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/v_if.jpg&quot; alt=&quot;v-if&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In the above example, we have created a button and two h1 tags with the message.&lt;/p&gt;
&lt;p&gt;A variable called show is declared and initialized to a value true. It is displayed close to the button. On the click of the button, we are calling a method&amp;nbsp;&lt;strong&gt;showdata&lt;/strong&gt;, which toggles the value of the variable show. This means on the click of the button, the value of the variable show will change from true to false and false to true.&lt;/p&gt;
&lt;p&gt;We have assigned if to the h1 tag as shown in the following code snippet.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-on:click&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;showdata&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;styleobj&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click Me&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;show&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is h1 tag&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Now what it will do is, it will check the value of the variable show and if its true the h1 tag will be displayed. Click the button and view in the browser, as the value of the show variable changes to false, the h1 tag is not displayed in the browser. It is displayed only when the show variable is true.&lt;/p&gt;
&lt;p&gt;Following is the display in the browser.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/show_tag.jpg&quot; alt=&quot;Show Tag&quot; /&gt;&lt;/p&gt;
&lt;p&gt;If we check in the browser, this is what we get when show is false.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/show_false.jpg&quot; alt=&quot;Show False&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The h1 tag is removed from the DOM when the variable show is set to false.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/h1_tag_removed.jpg&quot; alt=&quot;h1 Tag Removed&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This is what we see when the variable is true. The h1 tag is added back to the DOM when the variable show is set to true.&lt;/p&gt;
&lt;h3&gt;v-else&lt;/h3&gt;
&lt;p&gt;In the following example, we have added v-else to the second h1 tag.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;databinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-on:click&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;showdata&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;styleobj&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click Me&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;b&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{show}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;show&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is h1 tag&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h2&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-else&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is h2 tag&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#databinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               show&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               styleobj&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  backgroundColor&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#2196F3!important&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  cursor&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;pointer&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  padding&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;8px 16px&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  verticalAlign&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;middle&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               showdata &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;show &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;show&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;v-else is added using the following code snippet.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;show&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is h1 tag&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;h2&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-else&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is h2 tag&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Now, if show is true&amp;nbsp;&lt;strong&gt;&amp;ldquo;This is h1 tag&amp;rdquo;&lt;/strong&gt;&amp;nbsp;will be displayed, and if false&amp;nbsp;&lt;strong&gt;&amp;ldquo;This is h2 tag&amp;rdquo;&lt;/strong&gt;&amp;nbsp;will be displayed. This is what we will get in the browser.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/vue_if_true.jpg&quot; alt=&quot;Vue-If True&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The above display is when the show variable is true. Since, we have added v-else, the second statement is not present. Now, when we click the button the show variable will become false and the second statement will be displayed as shown in the following screenshot.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/vue_if_false.jpg&quot; alt=&quot;Vue-If False&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;v-show&lt;/h3&gt;
&lt;p&gt;v-show behaves same as v-if. It also shows and hides the elements based on the condition assigned to it. The difference between v-if and v-show is that v-if removes the HTML element from the DOM if the condition is false, and adds it back if the condition is true. Whereas v-show hides the element, if the condition is false with display:none. It shows the element back, if the condition is true. Thus, the element is present in the dom always.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;databinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-on:click&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;showdata&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;styleobj&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click Me&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;b&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{show}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;show&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is h1 tag&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h2&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-else&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is h2 tag&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-show&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;show&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;b&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;V-Show:&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/b&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;images/img.jpg&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;100&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;height&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;100&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#databinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               show&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               styleobj&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  backgroundColor&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#2196F3!important&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  cursor&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;pointer&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  padding&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;8px 16px&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  verticalAlign&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;middle&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               showdata &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;show &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;show&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;v-show is assigned to the HTML element using the following code snippet.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-show&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;show&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;b&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;V-Show:&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/b&amp;gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;images/img.jpg&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;100&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;height&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;100&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We have used the same variable show and based on it being true/false, the image is displayed in the browser.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/image_true.jpg&quot; alt=&quot;Image True&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now, since the variable show is true, the image is as displayed in the above screenshot. Let us click the button and see the display.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/button.jpg&quot; alt=&quot;Button&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The variable show is false, hence the image is hidden. If we inspect and see the element, the div along with the image is still a part of the DOM with the style property display: none as seen in the above screenshot.&lt;/p&gt;
&lt;h2&gt;List Rendering&lt;/h2&gt;
&lt;h3&gt;v-for&lt;/h3&gt;
&lt;p&gt;Let us now discuss list rendering with v-for directive.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;databinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-on:keyup&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;enter&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;showinputvalue&quot;&lt;/span&gt;
            &lt;span class=&quot;atn&quot;&gt;v-bind:style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;styleobj&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;placeholder&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Enter Fruits Names&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;items.length&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;0&quot;&amp;gt;Display Fruits Name&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-for&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;a in items&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{a}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#databinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               items&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:[],&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               styleobj&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;30%&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  padding&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;12px 20px&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  margin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;8px 0&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  boxSizing&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;border-box&quot;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               showinputvalue &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;items&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;target&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;A variable called items is declared as an array. In methods, there is a method called&amp;nbsp;&lt;strong&gt;showinputvalue&lt;/strong&gt;, which is assigned to the input box that takes the names of the fruits. In the method, the fruits entered inside the textbox are added to the array using the following piece of code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;showinputvalue &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;items&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;target&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We have used v-for to display the fruits entered as in the following piece of code. V-for helps to iterate over the values present in the array.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-for&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;a in items&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{a}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;To iterate over the array with for loop, we have to use v-for = &amp;rdquo;a in items&amp;rdquo; where a holds the values in the array and will display till all the items are done.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Following is the output in the browser.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/v_for.jpg&quot; alt=&quot;V-for&quot; /&gt;&lt;/p&gt;
&lt;p&gt;On inspecting the items, this is what it shows in the browser. In the DOM, we don&amp;rsquo;t see any v-for directive to the li element. It displays the DOM without any VueJS directives.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/v_for_directives.jpg&quot; alt=&quot;V-for Directives&quot; /&gt;&lt;/p&gt;
&lt;p&gt;If we wish to display the index of the array, it is done using the following code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;databinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-on:keyup&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;enter&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;showinputvalue&quot;&lt;/span&gt;
            &lt;span class=&quot;atn&quot;&gt;v-bind:style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;styleobj&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;placeholder&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Enter Fruits Names&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;items.length&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;0&quot;&amp;gt;Display Fruits Name&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-for&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;(a, index) in items&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{index}}--{{a}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#databinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               items&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:[],&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               styleobj&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;30%&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  padding&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;12px 20px&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  margin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;8px 0&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  boxSizing&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;border-box&quot;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               showinputvalue &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;items&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;target&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;To get the index, we have added one more variable in the bracket as shown in the following piece of code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;li&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-for&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;(a, index) in items&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{index}}--{{a}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;In (a, index),&amp;nbsp;&lt;strong&gt;a&lt;/strong&gt;&amp;nbsp;is the value and&amp;nbsp;&lt;strong&gt;index&lt;/strong&gt;&amp;nbsp;is the key. The browser display will now be as shown in the following screenshot. Thus, with the help of index any specific values can be displayed.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/index.jpg&quot; alt=&quot;Index&quot; /&gt;&lt;/p&gt;

&lt;h1&gt;Transition &amp; Animation&lt;/h1&gt;
&lt;p&gt;In this chapter, we will discuss the transition and animation features available in VueJS.&lt;/p&gt;
&lt;h2&gt;Transition&lt;/h2&gt;
&lt;p&gt;VueJS provides various ways to apply transition to the HTML elements when they are added/updated in the DOM. VueJS has a built-in transition component that needs to be wrapped around the element, which needs transition.&lt;/p&gt;
&lt;h3&gt;Syntax&lt;/h3&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&amp;lt;transition name = &quot;nameoftransition&quot;&amp;gt;
   &amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/transition&amp;gt;
&lt;/pre&gt;
&lt;p&gt;Let us consider an example to understand the working of transition.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;fade&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;enter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;active&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;fade&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;leave&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;active &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            transition&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; opacity &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;2s&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;fade&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;enter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;fade&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;leave&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;to &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;/* .fade-leave-active below version 2.1.8 */&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            opacity&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;databinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-on:click&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;show = !show&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click Me&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;transition&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;fade&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-show&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;show&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;styleobj&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Animation Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/transition&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#databinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               show&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               styleobj &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  fontSize&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;30px&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;red&#39;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;There is button called clickme created using which we can change the value of the variable show to true to false and vice versa. There is a&amp;nbsp;&lt;strong&gt;p tag&lt;/strong&gt;&amp;nbsp;which shows the text element only if the variable is true. We have wrapped the p tag with the transition element as shown in the following piece of code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;transition&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;fade&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-show&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;show&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;styleobj&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Animation Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/transition&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The name of the transition is&amp;nbsp;&lt;strong&gt;fade&lt;/strong&gt;. VueJS provides some standard classes for transition and the classes are prefixed with the name of the transition.&lt;/p&gt;
&lt;p&gt;Following are some standard classes for transition &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;v-enter&lt;/strong&gt;&amp;nbsp;&amp;minus; This class is called initially before the element is updated/added. Its the starting state.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;v-enter-active&lt;/strong&gt;&amp;nbsp;&amp;minus; This class is used to define the delay, duration, and easing curve for entering in the transition phase. This is the active state for entire and the class is available during the entire entering phase.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;v-leave&lt;/strong&gt;&amp;nbsp;&amp;minus; Added when the leaving transition is triggered, removed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;v-leave-active&lt;/strong&gt;&amp;nbsp;&amp;minus; Applied during the leaving phase. It is removed when the transition is done. This class is used to apply the delay, duration, and easing curve during the leaving phase.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Each of the above classes will be prefixed with the name of the transition. We have given the name of the transition as fade, hence the name of the classes becomes&amp;nbsp;&lt;strong&gt;.fade_enter, .fade_enter_active, .fade_leave, .fade_leave_active&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;They are defined in the following code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;fade&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;enter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;active&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;fade&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;leave&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;active &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      transition&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; opacity &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;2s&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;fade&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;enter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;fade&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;leave&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;to &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;/* .fade-leave-active below version 2.1.8 */&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      opacity&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The .fade_enter_active and .fade_leave_active are defined together and it applies a transition at the start and at the leaving stage. The opacity property is changed to 0 in 2 seconds.&lt;/p&gt;
&lt;p&gt;The duration is defined in the .fade_enter_active and .fade_leave_active. The final stage is defined in the .fade_enter, .fade_leave_to.&lt;/p&gt;
&lt;p&gt;The display in the browser is as follows.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/vue_transition.jpg&quot; alt=&quot;Vue Transition&quot; /&gt;&lt;/p&gt;
&lt;p&gt;On the click of the button, the text will fade away in two seconds.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/fade.jpg&quot; alt=&quot;Fade&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After two seconds, the text will disappear completely.&lt;/p&gt;
&lt;p&gt;Let us consider another example, where there is an image and it is shifted on the x-axis when the button is clicked.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;shiftx&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;enter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;active&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;shiftx&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;leave&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;active &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            transition&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; all &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;2s&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; ease&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;shiftx&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;enter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;shiftx&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;leave&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;to &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;/* .fade-leave-active below version 2.1.8 */&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            transform &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;  translateX&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;100px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;databinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-on:click&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;show = !show&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click Me&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;transition&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;shiftx&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-show&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;show&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;images/img.jpg&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;100px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;100px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/transition&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#databinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               show&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The name of the transition is&amp;nbsp;&lt;strong&gt;shiftx&lt;/strong&gt;. A transform property is used to shift the image on the x-axis by 100px using the following piece of code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;shiftx&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;enter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;active&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;shiftx&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;leave&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;active &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      transition&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; all &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;2s&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; ease&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;shiftx&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;enter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;shiftx&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;leave&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;to &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;/* .fade-leave-active below version 2.1.8 */&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      transform &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;  translateX&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;100px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Following is the output.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/shiftx.jpg&quot; alt=&quot;Shiftx&quot; /&gt;&lt;/p&gt;
&lt;p&gt;On the click of the button, the image will shift 100px towards the right as shown in the following screenshot.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/image_right.jpg&quot; alt=&quot;Image Right&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Animation&lt;/h2&gt;
&lt;p&gt;Animations are applied the same way as transition is done. Animation also has classes that needs to be declared for the effect to take place.&lt;/p&gt;
&lt;p&gt;Let us consider an example to see how animation works.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;shiftx&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;enter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;active &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            animation&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; shift&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;2s&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;shiftx&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;leave&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;active &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            animation&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; shift&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;2s&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; reverse&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;lit&quot;&gt;@keyframes&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; shift&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;   &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;rotateX&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0deg&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);}&lt;/span&gt;
            &lt;span class=&quot;lit&quot;&gt;25&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;  &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;rotateX&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;90deg&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);}&lt;/span&gt;
            &lt;span class=&quot;lit&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;  &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;rotateX&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;120deg&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);}&lt;/span&gt;
            &lt;span class=&quot;lit&quot;&gt;75&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;  &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;rotateX&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;180deg&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);}&lt;/span&gt;
            &lt;span class=&quot;lit&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;rotateX&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;360deg&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;databinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-on:click&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;show = !show&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click Me&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;transition&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;shiftx&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-show&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;show&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;images/img.jpg&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;100px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;100px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/transition&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#databinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               show&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;To apply animation, there are classes same as transition. In the above code, we have an image enclosed in p tag as shown in the following piece of code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;transition&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;shiftx&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-show&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;show&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;images/img.jpg&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;100px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;100px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/transition&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The name of the transition is&amp;nbsp;&lt;strong&gt;shiftx&lt;/strong&gt;. The class applied is as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;shiftx&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;enter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;active &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      animation&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; shift&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;2s&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;shiftx&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;leave&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;active &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      animation&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; shift&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;2s&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; reverse&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;lit&quot;&gt;@keyframes&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; shift&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;   &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;rotateX&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0deg&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);}&lt;/span&gt;
      &lt;span class=&quot;lit&quot;&gt;25&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;  &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;rotateX&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;90deg&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);}&lt;/span&gt;
      &lt;span class=&quot;lit&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;  &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;rotateX&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;120deg&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);}&lt;/span&gt;
      &lt;span class=&quot;lit&quot;&gt;75&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;  &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;rotateX&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;180deg&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);}&lt;/span&gt;
      &lt;span class=&quot;lit&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;rotateX&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;360deg&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);}&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The class is prefixed with the transition name, i.e. shiftx-enter-active and .shiftx-leave-active. The animation is defined with the keyframes from 0% to 100%. There is a transform defined at each of the keyframes is as shown in the following piece of code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;lit&quot;&gt;@keyframes&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; shift&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;   &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;rotateX&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0deg&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);}&lt;/span&gt;
   &lt;span class=&quot;lit&quot;&gt;25&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;  &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;rotateX&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;90deg&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);}&lt;/span&gt;
   &lt;span class=&quot;lit&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;  &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;rotateX&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;120deg&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);}&lt;/span&gt;
   &lt;span class=&quot;lit&quot;&gt;75&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;  &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;rotateX&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;180deg&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);}&lt;/span&gt;
   &lt;span class=&quot;lit&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;rotateX&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;360deg&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Following is the output.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/animation.jpg&quot; alt=&quot;Animation&quot; /&gt;&lt;/p&gt;
&lt;p&gt;On clicking the button, it rotates from 0 to 360 degree and disappears.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/change_degree.jpg&quot; alt=&quot;Change Degree&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Custom Transition Classes&lt;/h2&gt;
&lt;p&gt;VueJS provides a list of custom classes, which can be added as attributes to the transition element.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;enter-class&lt;/li&gt;
&lt;li&gt;enter-active-class&lt;/li&gt;
&lt;li&gt;leave-class&lt;/li&gt;
&lt;li&gt;leave-active-class&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Custom classes basically come into play when we want to use an external CSS library such as animate.css.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://cdn.jsdelivr.net/npm/animate.css@3.5.1&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;rel&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;stylesheet&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/css&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;animate&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;align&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; @&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;click&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;show = !show&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Animate&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;transition&lt;/span&gt;
            &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;custom-classes-transition&quot;&lt;/span&gt;
            &lt;span class=&quot;atn&quot;&gt;enter-active-class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;animated swing&quot;&lt;/span&gt;
            &lt;span class=&quot;atn&quot;&gt;leave-active-class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;animated bounceIn&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;show&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/transition&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;  &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#animate&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               show&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/custom_classes_transision.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/animated_swing.jpg&quot; alt=&quot;Animated Swing&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/animated_bouncein.jpg&quot; alt=&quot;Animated BounceIn&quot; /&gt;&lt;/p&gt;
&lt;p&gt;There are two animations applied in the above code. One enter-active-class = &amp;ldquo;animated swing&amp;rdquo; and another leave-active-class = &amp;rdquo;animated bounceIn&amp;rdquo;. We are making the use of custom animation classes for the animation to be applied from the third party library.&lt;/p&gt;
&lt;h2&gt;Explicit Transition Duration&lt;/h2&gt;
&lt;p&gt;We can apply transition and animation on the element using VueJS. Vue waits for the transionend and animationend event to detect if the animation or transition is done.&lt;/p&gt;
&lt;p&gt;Sometimes the transition can cause delay. In such cases, we can apply the duration explicitly as follows.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;transition&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;duration&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;1000&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/transition&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;transition&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;duration&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;{ enter: 500, leave: 800 }&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/transition&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We can use the duration property with a : on the transition element as shown above. In case there is a need to specify the duration separately for entering and leaving, it can be done as shown in the above piece of code.&lt;/p&gt;
&lt;h2&gt;JavaScript Hooks&lt;/h2&gt;
&lt;p&gt;The transition classes can be called as methods using JavaScript events. Let us consider an example for better understanding.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://cdnjs.cloudflare.com/ajax/libs/velocity/1.2.3/velocity.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;example-4&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; @&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;click&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;show = !show&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Toggle&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;transition&lt;/span&gt;  &lt;span class=&quot;atn&quot;&gt;v-on:before-enter&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;beforeEnter&quot;&lt;/span&gt;
            &lt;span class=&quot;atn&quot;&gt;v-on:enter&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;enter&quot;&lt;/span&gt;
            &lt;span class=&quot;atn&quot;&gt;v-on:leave&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;leave&quot;&lt;/span&gt;
            &lt;span class=&quot;atn&quot;&gt;v-bind:css&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;false&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;show&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Animation Example with velocity&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/transition&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#example-4&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               show&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;false&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               beforeEnter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;opacity &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               enter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; done&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;typ&quot;&gt;Velocity&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; opacity&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; fontSize&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;25px&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; duration&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1000&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;
                  &lt;span class=&quot;typ&quot;&gt;Velocity&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; fontSize&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;10px&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; complete&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; done &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               leave&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; done&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;typ&quot;&gt;Velocity&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; translateX&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;15px&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; rotateZ&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;50deg&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; duration&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1500&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;
                  &lt;span class=&quot;typ&quot;&gt;Velocity&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; rotateZ&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;100deg&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; loop&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;
                  &lt;span class=&quot;typ&quot;&gt;Velocity&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                     rotateZ&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;45deg&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                     translateY&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;30px&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                     translateX&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;30px&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                     opacity&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;
                  &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; complete&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; done &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/javascript_hooks.jpg&quot; alt=&quot;JavaScript Hooks&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/jshooks.jpg&quot; alt=&quot;JsHooks&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In the above example, we are performing animation using js methods on the transition element.&lt;/p&gt;
&lt;p&gt;The methods on transition are applied as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;transition&lt;/span&gt;  &lt;span class=&quot;atn&quot;&gt;v-on:before-enter&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;beforeEnter&quot;&lt;/span&gt;
   &lt;span class=&quot;atn&quot;&gt;v-on:enter&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;enter&quot;&lt;/span&gt;
   &lt;span class=&quot;atn&quot;&gt;v-on:leave&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;leave&quot;&lt;/span&gt;
   &lt;span class=&quot;atn&quot;&gt;v-bind:css&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;false&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;show&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Animation Example with velocity&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/transition&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;There is a prefix added&amp;nbsp;&lt;strong&gt;v-on&lt;/strong&gt;&amp;nbsp;and the name of the event to which the method is called. The methods are defined in the Vue instance as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;methods&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   beforeEnter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;opacity &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   enter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;done&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;typ&quot;&gt;Velocity&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; opacity&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; fontSize&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;25px&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; duration&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1000&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;
      &lt;span class=&quot;typ&quot;&gt;Velocity&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; fontSize&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;10px&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; complete&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;done&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   leave&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;done&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;typ&quot;&gt;Velocity&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; translateX&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;15px&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; rotateZ&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;50deg&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; duration&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1500&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;
      &lt;span class=&quot;typ&quot;&gt;Velocity&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; rotateZ&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;100deg&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; loop&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;
      &lt;span class=&quot;typ&quot;&gt;Velocity&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         rotateZ&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;45deg&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         translateY&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;30px&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         translateX&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;30px&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         opacity&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; complete&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;done&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The required transition is applied in each of these methods. There is an opacity animation applied on the click of the button and also when the animation is done. Third party library is used for animation.&lt;/p&gt;
&lt;p&gt;There is a property added on transition v-bind:css = &quot;false&quot;, which is done so that Vue understands it is a JavaScript transition.&lt;/p&gt;
&lt;h2&gt;Transition at the Initial Render&lt;/h2&gt;
&lt;p&gt;In order to add animation at the start, we need to add &amp;lsquo;appear&amp;rsquo; property to the transition element.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s look at an example to understand it better.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://cdn.jsdelivr.net/npm/animate.css@3.5.1&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;rel&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;stylesheet&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/css&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;animate&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;align&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;transition&lt;/span&gt;
            &lt;span class=&quot;atn&quot;&gt;appear&lt;/span&gt;
            &lt;span class=&quot;atn&quot;&gt;appear-class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;custom-appear-class&quot;&lt;/span&gt;
            &lt;span class=&quot;atn&quot;&gt;appear-active-class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;animated bounceIn&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;BounceIn - Animation Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/transition&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;transition&lt;/span&gt;
            &lt;span class=&quot;atn&quot;&gt;appear&lt;/span&gt;
            &lt;span class=&quot;atn&quot;&gt;appear-class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;custom-appear-class&quot;&lt;/span&gt;
            &lt;span class=&quot;atn&quot;&gt;appear-active-class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;animated swing&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Swing - Animation Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/transition&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;transition&lt;/span&gt;
            &lt;span class=&quot;atn&quot;&gt;appear&lt;/span&gt;
            &lt;span class=&quot;atn&quot;&gt;appear-class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;custom-appear-class&quot;&lt;/span&gt;

&lt;h1&gt;Directives&lt;/h1&gt;
&lt;p&gt;Directives are instruction for VueJS to do things in a certain way. We have already seen directives such as v-if, v-show, v-else, v-for, v-bind , v-model, v-on, etc.&lt;/p&gt;
&lt;p&gt;In this chapter, we will take a look at custom directives. We will create global directives similar to how we did for components.&lt;/p&gt;
&lt;h3&gt;Syntax&lt;/h3&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;Vue.directive(&#39;nameofthedirective&#39;, {
   bind(e1, binding, vnode) {
   }
})
&lt;/pre&gt;
&lt;p&gt;We need to create a directive using Vue.directive. It takes the name of the directive as shown above. Let us consider an example to show the details of the working of directives.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;databinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-changestyle&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJS Directive&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;directive&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;changestyle&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            bind&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;e1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;binding&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vnode&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;e1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               e1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;red&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               e1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;fontSize &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;30px&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#databinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;In this example, we have created a custom directive&amp;nbsp;&lt;strong&gt;changestyle&lt;/strong&gt;&amp;nbsp;as shown in the following piece of code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;directive&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;changestyle&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   bind&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;e1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;binding&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vnode&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;e1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      e1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;red&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      e1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;fontSize &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;30px&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We are assigning the following changestyle to a div.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-changestyle&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJS Directive&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;If we see in the browser, it will display the text VueJs Directive in red color and the fontsize is increased to 30px.&lt;/p&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/fontsize.jpg&quot; alt=&quot;FontSize&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We have used the bind method, which is a part of the directive. It takes three arguments&amp;nbsp;&lt;strong&gt;e1&lt;/strong&gt;, the element to which the custom directive needs to be applied. Binding is like arguments passed to the custom directive, e.g. v-changestyle = &amp;rdquo;{color:&amp;rsquo;green&amp;rsquo;}&amp;rdquo;, where green will be read in the binding argument and vnode is the element, i.e. nodename.&lt;/p&gt;
&lt;p&gt;In the next example, we have consoled all the arguments and its shows what details each of them give.&lt;/p&gt;
&lt;p&gt;Following is an example with a value passed to the custom directive.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;databinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-changestyle&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;{color:&#39;green&#39;}&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJS Directive&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;directive&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;changestyle&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            bind&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;e1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;binding&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vnode&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;e1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;binding&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;vnode&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               e1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;binding&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               e1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;fontSize &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;30px&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#databinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/color_change.jpg&quot; alt=&quot;Colour Change&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The color of the text is changed to green. The value is passed using the following piece of code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-changestyle&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;{color:&#39;green&#39;}&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJS Directive&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
And it is accessed using the following piece of code.
Vue.directive(&quot;changestyle&quot;,{
   bind(e1,binding, vnode) {
      console.log(e1);
      console.log(binding.value.color);
      console.log(vnode);
      e1.style.color=binding.value.color;
      e1.style.fontSize = &quot;30px&quot;;
   }
});&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;Filters&lt;/h2&gt;
&lt;p&gt;VueJS supports filters that help with text formatting. It is used along with v-bind and interpolations ({{}}). We need a pipe symbol at the end of JavaScript expression for filters.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;databinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt;  &lt;span class=&quot;atn&quot;&gt;v-model&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;name&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;placeholder&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Enter Name&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&amp;lt;br/&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;b&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Letter count is : {{name | countletters}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#databinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&quot;&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            filters &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               countletters &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; value&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;In the above example, we have created a simple filter countletters. Countletters filter counts the numbers of characters entered in the textbox. To make use of filters, we need to use the filter property and define the filter used, by the following piece of code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;filters &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   countletters &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; value&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We are defining the method&amp;nbsp;&lt;strong&gt;countletters&lt;/strong&gt;&amp;nbsp;and returning the length of the string entered.&lt;/p&gt;
&lt;p&gt;To use filter in the display, we have used the pipe operator and the name of the filter, i.e.&amp;nbsp;&lt;strong&gt;countletters&lt;/strong&gt;.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;b&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Letter count is : {{name | countletters}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Following is the display in the browser.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/countletter.jpg&quot; alt=&quot;CountLetter&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can also pass arguments to the filter using the following piece of code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;b&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Letter count is : {{name | countletters(&#39;a1&#39;, &#39;a2&#39;)}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Now, the&amp;nbsp;&lt;strong&gt;countletters&lt;/strong&gt;&amp;nbsp;will have three params, i.e.&amp;nbsp;&lt;strong&gt;message, a1, and a2&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;We can also pass multiple filters to the interpolation using the following piece of code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;b&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Letter count is : {{name | countlettersA, countlettersB}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;In the filter property&amp;nbsp;&lt;strong&gt;countlettersA&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;countlettersB&lt;/strong&gt;&amp;nbsp;will be the two methods and the&amp;nbsp;&lt;strong&gt;countlettersA&lt;/strong&gt;&amp;nbsp;will pass the details to&amp;nbsp;&lt;strong&gt;countlettersB&lt;/strong&gt;.&lt;/p&gt;

&lt;h1&gt;Routing&lt;/h1&gt;
&lt;p&gt;VueJS does not have a built-in router feauture. We need to follow some additional steps to install it.&lt;/p&gt;
&lt;h3&gt;Direct Download from CDN&lt;/h3&gt;
&lt;p&gt;The latest version of vue-router is available at&amp;nbsp;&lt;a href=&quot;https://unpkg.com/vue-router@3.0.1/dist/vue-router.js&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://unpkg.com/vue-router/dist/vue-router.js&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Unpkg.com provides npm-based cdn links. The above link is always updated to the recent version. We can download and host it, and use it with a script tag along with vue.js as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/path/to/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/path/to/vue-router.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Using NPM&lt;/h3&gt;
&lt;p&gt;Run the following command to install the vue-router.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;npm  install vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;router&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Using GitHub&lt;/h3&gt;
&lt;p&gt;We can clone the repository from GitHub as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;git clone https&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;com&quot;&gt;//github.com/vuejs/vue-router.git node_modules/vue-router&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
cd node_modules&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;router
npm install
npm run build&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Let us start with a simple example using vue-router.js.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue-router.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;app&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Routing Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;router-link&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/route1&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Router Link 1&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/router-link&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;router-link&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/route2&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Router Link 2&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/router-link&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;&amp;lt;!-- route outlet --&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;&amp;lt;!-- component matched by the route will render here --&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;router-view&amp;gt;&amp;lt;/router-view&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Route1&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; template&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;div style = &quot;border-radius:20px;background-color:cyan;width:200px;height:50px;margin:10px;font-size:25px;padding:10px;&quot;&amp;gt;This is router 1&amp;lt;/div&amp;gt;&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Route2&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; template&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;div style = &quot;border-radius:20px;background-color:green;width:200px;height:50px;margin:10px;font-size:25px;padding:10px;&quot;&amp;gt;This is router 2&amp;lt;/div&amp;gt;&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; routes &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; path&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;/route1&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; component&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Route1&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; path&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;/route2&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; component&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Route2&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;];&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; router &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;VueRouter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            routes &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// short for `routes: routes`&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#app&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            router
         &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/route1_link.jpg&quot; alt=&quot;Route1 Link&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/route2_link.jpg&quot; alt=&quot;Route2 Link&quot; /&gt;&lt;/p&gt;
&lt;p&gt;To start with routing, we need to add the vue-router.js file. Take the code from&amp;nbsp;&lt;a href=&quot;https://unpkg.com/vue-router@3.0.1/dist/vue-router.js&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://unpkg.com/vue-router/dist/vue-router.js&lt;/a&gt;&amp;nbsp;and save it in the file vue-router.js.&lt;/p&gt;
&lt;p&gt;The script is added after vue.js as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue-router.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;In the body section, there is a router link defined as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;router-link&lt;/span&gt;   &lt;span class=&quot;atn&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/route1&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Router Link 1&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/router-link&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;router-link&lt;/span&gt;    &lt;span class=&quot;atn&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/route2&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Router Link 2&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/router-link&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;&amp;lt;router-link&amp;gt;&lt;/strong&gt;&amp;nbsp;is a component used to navigate to the HTML content to be displayed to the user. The to property is the destination, i.e the source file where the contents to be displayed will be picked.&lt;/p&gt;
&lt;p&gt;In the above piece of code, we have created two router links.&lt;/p&gt;
&lt;p&gt;Take a look at the script section where the router is initialized. There are two constants created as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;const&lt;/span&gt;  &lt;span class=&quot;typ&quot;&gt;Route1&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;template&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;div style = &quot;border-radius:20px;background-color:cyan;width:200px;height:50px;margin:10px;font-size:25px;padding:10px;&quot;&amp;gt;This is router 1&amp;lt;/div&amp;gt;&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;};&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Route2&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;template&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;div style = &quot;border-radius:20px;background-color:green;width:200px;height:50px;margin:10px;font-size:25px;padding:10px;&quot;&amp;gt;This is router 2&amp;lt;/div&amp;gt;&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;They have templates, which needs to be shown when the router link is clicked.&lt;/p&gt;
&lt;p&gt;Next, is the routes const, which defines the path to be displayed in the URL.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; routes &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; path&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;/route1&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; component&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Route1&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; path&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;/route2&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; component&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Route2&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;];&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Routes define the path and the component. The path i.e.&amp;nbsp;&lt;strong&gt;/route1&lt;/strong&gt;&amp;nbsp;will be displayed in the URL when the user clicks on the router link.&lt;/p&gt;
&lt;p&gt;Component takes the templates names to be displayed. The path from the routes need to match with the router link to the property.&lt;/p&gt;
&lt;p&gt;For example, &amp;lt;router-link&amp;nbsp;&lt;strong&gt;to = &amp;rdquo;path here&amp;rdquo;&lt;/strong&gt;&amp;gt;&amp;lt;/router-link&amp;gt;&lt;/p&gt;
&lt;p&gt;Next, the instance is created to VueRouter using the following piece of code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; router &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;VueRouter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   routes &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// short for `routes: routes`&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The VueRouter constructor takes the routes as the param. The router object is assigned to the main vue instance using the following piece of code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#app&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   router
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Execute the example and see the display in the browser. On inspecting and checking the router link, we will find that it adds class to the active element as shown in the following screenshot.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/route_link.jpg&quot; alt=&quot;Route Link&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The class added is&amp;nbsp;&lt;strong&gt;class = &amp;ldquo;router-link-exact-active router-link-active&amp;rdquo;&lt;/strong&gt;. The active link gets the class as shown in the above screenshot. Another thing to notice is, the &amp;lt;router-link&amp;gt; gets rendered as a tag.&lt;/p&gt;
&lt;h2&gt;Props for Router Link&lt;/h2&gt;
&lt;p&gt;Let us see some more properties to be passed to &amp;lt;router-link&amp;gt;.&lt;/p&gt;
&lt;h3&gt;to&lt;/h3&gt;
&lt;p&gt;This is the destination path given to the &amp;lt;router-link&amp;gt;. When clicked, the value of to will be passed to router.push() internally. The value needs to be a string or a location object. When using an object, we need to bind it as shown in e.g. 2.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;pun&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;router&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;link to &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;/route1&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Router&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Link&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;router&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;link&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
renders &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;as&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a href &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;&amp;rdquo;&lt;/span&gt;&lt;span class=&quot;com&quot;&gt;#/route&amp;rdquo;&amp;gt;Router Link &amp;lt;/a&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
e&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;pun&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;router&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;link v&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;bind&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;to &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;{path:&#39;/route1&#39;}&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Router&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Link&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;router&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;link&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
e&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;router&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;link v&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;bind&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;to &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&quot;{path:&#39;/route1&#39;, query: { name: &#39;Tery&#39; }}&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Router&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Link&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;/router-link&amp;gt;/&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;router link &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; query &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Following is the output of e.g. 3.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/routing_example.jpg&quot; alt=&quot;Routing Example&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In the URL path, name = Tery is a part of the query string. E.g.: http://localhost/vueexamples/vue_router.html#/route1?name = Tery&lt;/p&gt;
&lt;h3&gt;replace&lt;/h3&gt;
&lt;p&gt;Adding replace to the router link will call the&amp;nbsp;&lt;strong&gt;router.replace()&lt;/strong&gt;&amp;nbsp;instead of&amp;nbsp;&lt;strong&gt;router.push()&lt;/strong&gt;. With replace, the navigation history is not stored.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;router-link&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:to&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;{path:&#39;/route1&#39;, query: { name: &#39;Tery&#39; }}&quot;&lt;/span&gt;   &lt;span class=&quot;atn&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Router Link 1&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/router-link&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;append&lt;/h3&gt;
&lt;p&gt;Adding append to the &amp;lt;router-link&amp;gt;&amp;lt;router-link&amp;gt; will make the path relative.&lt;/p&gt;
&lt;p&gt;If we want to go from the router link with path /route1 to router link path /route2, it will show the path in the browser as /route1/route2.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;router-link&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:to&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;{ path: &#39;/route1&#39;}&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Router Link 1&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/router-link&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;tag&lt;/h3&gt;
&lt;p&gt;At present &amp;lt;router-link&amp;gt; renders as a tag. In case, we want to render it as some other tag, we need to specifty the same using tag = &amp;rdquo;tagname&amp;rdquo;;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;router-link&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:to&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;{ path: &#39;/route1&#39;}&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;tag&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;span&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Router Link 1&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/router-link&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;router-link&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:to&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;{ path: &#39;/route2&#39;}&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;tag&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;span&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Router Link 2&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/router-link&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We have specified the tag as span and this is what is displayed in the browser.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/tag.jpg&quot; alt=&quot;Tag&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The tag displayed now is a span tag. We will still see the click going as we click on the router link for navigation.&lt;/p&gt;
&lt;h3&gt;active-class&lt;/h3&gt;
&lt;p&gt;By default, the active class added when the router link is active is router-link-active. We can overwrite the class by setting the same as shown in the following code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;_active&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; red&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;router-link&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:to&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;{ path: &#39;/route1&#39;}&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;active-class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;_active&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Router Link 1&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/router-link&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;router-link&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:to&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;{ path: &#39;/route2&#39;}&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;tag&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;span&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Router Link 2&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/router-link&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The class used is active_class = &amp;rdquo;_active&amp;rdquo;. This is the output displayed in the browser.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/active_class.jpg&quot; alt=&quot;Active Class&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;exact-active-class&lt;/h3&gt;
&lt;p&gt;The default exactactive class applied is router-link-exact-active. We can overwrite it using exact-active-class.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;router-link&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:to&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;{ path: &#39;/route1&#39;}&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;exact-active-class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;_active&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Router Link 1&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/router-link&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;router-link&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:to&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;{ path: &#39;/route2&#39;}&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;tag&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;span&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Router Link 2&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/router-link&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This is what is displayed in the browser.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/exact_active_class.jpg&quot; alt=&quot;Exact Active Class&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;event&lt;/h3&gt;
&lt;p&gt;At present, the default event for router-link is click event. We can change the same using the event property.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;router-link&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:to&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;{ path: &#39;/route1&#39;}&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;event&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;mouseover&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Router Link 1&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/router-link&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Now, when we mouseover the router link, it will navigate as shown in the following browser. Mouseover on the Router link 1 and we will see the navigation changing.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/default_event.jpg&quot; alt=&quot;Default Event&quot; /&gt;&lt;/p&gt;

&lt;h1&gt;Mixins&lt;/h1&gt;
&lt;p&gt;Mixins are basically to be used with components. They share reusable code among components. When a component uses mixin, all options of mixin become a part of the component options.&lt;/p&gt;
&lt;h2&gt;Example&lt;/h2&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;databinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#databinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myMixin &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            created&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;startmixin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               startmixin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Welcome  to mixin example&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;};&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Component&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;extend&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            mixins&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;myMixin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; component &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Component&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;Output&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/mixins.jpg&quot; alt=&quot;Mixins&quot; /&gt;&lt;/p&gt;
&lt;p&gt;When a mixin and a component contain overlapping options, they are merged as shown in the following example.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;databinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mixin &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            created&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;mixin called&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            mixins&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;mixin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            created&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;component called&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Now the mixin and the vue instance has the same method created. This is the output we see in the console. As seen, the option of the vue and the mixin will be merged.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/mixin_overlapping.jpg&quot; alt=&quot;Mixin Overlapping&quot; /&gt;&lt;/p&gt;
&lt;p&gt;If we happen to have the same function name in methods, then the main vue instance will take priority.&lt;/p&gt;
&lt;h2&gt;Example&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;databinding&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mixin &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               hellworld&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;In HelloWorld&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               samemethod&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Mixin:Same Method&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;};&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            mixins&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;mixin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               start&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;start method&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               samemethod&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Main: same method&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         vm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;hellworld&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         vm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         vm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;samemethod&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We will see mixin has a method property in which helloworld and samemethod functions are defined. Similarly, vue instance has a methods property in which again two methods are defined start and samemethod.&lt;/p&gt;
&lt;p&gt;Each of the following methods are called.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;vm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;hellworld&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;// In HelloWorld&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
vm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;// start method&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
vm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;samemethod&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;// Main: same method&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;As seen above, we have called helloworld, start, and samemethod function. samemethod is also present in mixin, however, priority will be given to the main instance, as seen in the following console.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/mixin_as_method.jpg&quot; alt=&quot;Mixin as Method&quot; /&gt;&lt;/p&gt;

&lt;h1&gt;Render Function&lt;/h1&gt;
&lt;p&gt;Let&amp;rsquo;s take a look at an example of a simple component and see what the render function has to do within it.&lt;/p&gt;
&lt;h2&gt;Example&lt;/h2&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;component_test&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;testcomponent&amp;gt;&amp;lt;/testcomponent&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;component&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;testcomponent&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            template &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;h1&amp;gt;Hello World&amp;lt;/h1&amp;gt;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:{&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#component_test&#39;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Consider the above example of a simple component that prints Hello World as shown in the following screenshot.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/render_function.jpg&quot; alt=&quot;Render Function&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now, if we want to reuse the component, we can do so by just printing it again. For example,&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;component_test&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;testcomponent&amp;gt;&amp;lt;/testcomponent&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;testcomponent&amp;gt;&amp;lt;/testcomponent&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;testcomponent&amp;gt;&amp;lt;/testcomponent&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;testcomponent&amp;gt;&amp;lt;/testcomponent&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;And the output will be the following.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/component_reuse.jpg&quot; alt=&quot;Component Reuse&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However, now we need some changes to the component. We don&amp;rsquo;t want the same text to be printed. How can we change it? In case, we type something inside the component, will it be take into consideration?&lt;/p&gt;
&lt;p&gt;Let us consider the following example and see what happens.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;component_test&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;testcomponent&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Hello Jai&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/testcomponent&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;testcomponent&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Hello Roy&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/testcomponent&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;testcomponent&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Hello Ria&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/testcomponent&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;testcomponent&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Hello Ben&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/testcomponent&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The output remains the same as we had seen earlier. It does not change the text as we want.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/component_reuse.jpg&quot; alt=&quot;Component Reuse&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Component does provide something called as&amp;nbsp;&lt;strong&gt;slots&lt;/strong&gt;. Let&amp;rsquo;s make use of it and see if we get the desired results.&lt;/p&gt;
&lt;h2&gt;Example&lt;/h2&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;component_test&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;testcomponent&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Hello Jai&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/testcomponent&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;testcomponent&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Hello Roy&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/testcomponent&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;testcomponent&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Hello Ria&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/testcomponent&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;testcomponent&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Hello Ben&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/testcomponent&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;component&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;testcomponent&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            template &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;h1&amp;gt;&amp;lt;slot&amp;gt;&amp;lt;/slot&amp;gt;&amp;lt;/h1&amp;gt;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:{&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#component_test&#39;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;As seen in the above code, in the template we have added slot, hence now it takes the value to send inside the component as shown in the following screenshot.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/slot_example.jpg&quot; alt=&quot;Slot Example&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now, let us consider we want to change the color and size. For example, currently we are using h1 tag and we want to change the HTML tag to p tag or div tag for the same component. How can we have the flexibility to carry out so many changes?&lt;/p&gt;
&lt;p&gt;We can do so with the help of the render function. Render function helps make the component dynamic and use the way it is required by keeping it common and helping pass arguments using the same component.&lt;/p&gt;
&lt;h2&gt;Example&lt;/h2&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;component_test&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;testcomponent&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;elementtype&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&#39;div,red,25,div1&#39;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Hello Jai&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/testcomponent&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;testcomponent&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;elementtype&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&#39;h3,green,25,h3tag&#39;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Hello Roy&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/testcomponent&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;testcomponent&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;elementtype&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&#39;p,blue,25,ptag&#39;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Hello Ria&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/testcomponent&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;testcomponent&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;elementtype&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&#39;div,green,25,divtag&#39;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Hello Ben&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/testcomponent&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;component&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;testcomponent&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            render &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;createElement&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;){&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;elementtype&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;,&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; createElement&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;],{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  attrs&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                     id&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                     style&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;color:&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]+&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;;font-size:&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]+&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;;&quot;&lt;/span&gt;
                  &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$slots&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;default&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            props&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               elementtype&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  attributes&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  required&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#component_test&#39;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;In the above code, we have changed the component and added the render function with props property using the following piece of code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;component&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;testcomponent&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   render &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;createElement&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;){&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;elementtype&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;,&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; createElement&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;],{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         attrs&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            id&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            style&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;color:&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]+&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;;font-size:&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]+&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;;&quot;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$slots&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;default&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   props&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      elementtype&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         attributes&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         required&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The props look like the following.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;props&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   elementtype&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      attributes&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      required&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We have defined a property called elementtype, which takes attributes field of type string. Another required field, which mentions that the field is mandatory.&lt;/p&gt;
&lt;p&gt;In the render function, we have used the elementtype property as seen in the following piece of code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;render &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;createElement&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;){&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;elementtype&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;,&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; createElement&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;],{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      attrs&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         id&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         style&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;color:&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]+&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;;font-size:&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]+&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;;&quot;&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$slots&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;default&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Render function takes createElement as the argument and returns the same. CreateElement creates the DOM element the same way as in JavaScript. We have also split the elementtype on comma, using the values in the attrs field.&lt;/p&gt;
&lt;p&gt;CreateElement is taking the first param as the elementtag to be created. It is passed to the component using the following piece of code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;testcomponent&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;  :&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;elementtype&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&#39;div,red,25,div1&#39;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Hello Jai&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/testcomponent&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The component needs to take the props field as shown above. It starts with : and the name of the props. Here, we are passing the element tag, color, fontsize, and the id of the element.&lt;/p&gt;
&lt;p&gt;In render function, in createElement, we are splitting on comma, so the first element is the elementtag, which is given to the createElemet as shown in the following piece of code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; createElement&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;],{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      attrs&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         id&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         style&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;color:&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]+&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;;font-size:&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]+&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;;&quot;&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$slots&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;default&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;a[0]&lt;/strong&gt;&amp;nbsp;is the html element tag. The next parameter is the attributes for the element tag. They are defined in the attr field in the following piece of code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;attrs&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   id&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   style&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;color:&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]+&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;;font-size:&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]+&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;;&quot;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We have defined two attributes for the element tag -&amp;nbsp;&lt;strong&gt;id&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;style&lt;/strong&gt;. To id, we are passing a[3], which is the value we have after splitting on comma. Using style, we have defined color and fontsize.&lt;/p&gt;
&lt;p&gt;Last is the slot, that is the message we have given in the componentin the following piece of code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;testcomponent&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;elementtype&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&#39;div,red,25,div1&#39;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Hello Jai&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/testcomponent&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We have defined the text to be printed in the createElement using the following piece of code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$slots&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;default&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;It takes the default assigned in the component field.&lt;/p&gt;
&lt;p&gt;Following is the output we get in the browser.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/component_field.jpg&quot; alt=&quot;Component Field&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The elements also show the structure. These are the components we have defined &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;component_test&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;testcomponent&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;elementtype&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&#39;div,red,25,div1&#39;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Hello Jai&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/testcomponent&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;testcomponent&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;elementtype&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&#39;h3,green,25,h3tag&#39;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Hello Roy&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/testcomponent&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;testcomponent&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;elementtype&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&#39;p,blue,25,ptag&#39;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Hello Ria&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/testcomponent&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;testcomponent&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; :&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;elementtype&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&#39;div,green,25,divtag&#39;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Hello Ben&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/testcomponent&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;h1&gt;Reactive Interface&lt;/h1&gt;
&lt;p&gt;VueJS provides options to add reactivity to properties, which are added dynamically. Consider that we have already created vue instance and need to add the watch property. It can be done as follows &amp;minus;&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;app&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Counter: {{ counter }}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; @&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;click&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;counter++&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click Me&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#app&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               counter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         vm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$watch&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;counter&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;nval&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; oval&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Counter is incremented :&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; oval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39; to &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; nval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;!&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         setTimeout&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(){&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               vm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;counter &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;2000&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;There is a property counter defined as 1 in data object. The counter is incremented when we click the button.&lt;/p&gt;
&lt;p&gt;Vue instance is already created. To add watch to it, we need to do it as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;vm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$watch&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;counter&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;nval&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; oval&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Counter is incremented :&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; oval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39; to &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; nval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;!&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We need to use $watch to add watch outside the vue instance. There is an alert added, which shows the value change for the counter property. There is also a timer function added, i.e. setTimeout, which sets the counter value to 20.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;setTimeout&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(){&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      vm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;counter &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;2000&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Whenever the counter is changed, the alert from the watch method will get fired as shown in the following screenshot.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/counter.jpg&quot; alt=&quot;Counter&quot; /&gt;&lt;/p&gt;
&lt;p&gt;VueJS cannot detect property addition and deletion. The best way is to always declare the properties, which needs to be reactive upfront in the Vue instance. In case we need to add properties at run time, we can make use of Vue global, Vue.set, and Vue.delete methods.&lt;/p&gt;
&lt;h2&gt;Vue.set&lt;/h2&gt;
&lt;p&gt;This method helps to set a property on an object. It is used to get around the limitation that Vue cannot detect property additions.&lt;/p&gt;
&lt;h3&gt;Syntax&lt;/h3&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;Vue.set( target, key, value )
&lt;/pre&gt;
&lt;p&gt;Where,&lt;/p&gt;
&lt;p&gt;target: Can be an object or an array&lt;/p&gt;
&lt;p&gt;key : Can be a string or number&lt;/p&gt;
&lt;p&gt;value: Can be any type&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s take a look at an example.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;app&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Counter: {{ products.id }}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; @&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;click&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;products.id++&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click Me&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myproduct &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;book&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;price&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;20.00&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;};&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#app&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               counter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               products&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myproduct
            &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         vm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;products&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;qty &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;1&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;vm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         vm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$watch&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;counter&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;nval&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; oval&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Counter is incremented :&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; oval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39; to &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; nval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;!&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;In the above example, there is a variable myproduct created at the start using the following piece of code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myproduct &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;book&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;price&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;20.00&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;};&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;It is given to the data object in Vue instance as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#app&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      counter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      products&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myproduct
   &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Consider, we want to add one more property to the myproduct array, after the Vue instance is created. It can be done as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;vm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;products&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;qty &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;1&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Let&amp;rsquo;s see the output in the console.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/myproduct_array.jpg&quot; alt=&quot;MyProduct Array&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As seen above, in products the quantity is added. The get/set methods, which basically adds reactivity is available for the id, name, and price, and not available for qty.&lt;/p&gt;
&lt;p&gt;We cannot achieve the reactivity by just adding vue object. VueJS mostly wants all its properties to be created at the start. However, in case we need to add it later, we can use Vue.set. For this, we need to set it using vue global, i.e. Vue.set.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;app&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Counter: {{ products.id }}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; @&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;click&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;products.id++&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click Me&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myproduct &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;book&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;price&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;20.00&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;};&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#app&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               counter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               products&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myproduct
            &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
         &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;myproduct&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;qty&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;vm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         vm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$watch&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;counter&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;nval&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; oval&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Counter is incremented :&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; oval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39; to &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; nval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;!&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We have used Vue.set to add the qty to the array using the following piece of code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;myproduct&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;qty&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We have consoled the vue object and following is the output.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/products.jpg&quot; alt=&quot;Products&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now, we can see the get/set for qty added using Vue.set.&lt;/p&gt;
&lt;h2&gt;Vue.delete&lt;/h2&gt;
&lt;p&gt;This function is used to delete the property dynamically.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;delete&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; target&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; key &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Where,&lt;/p&gt;
&lt;p&gt;target: Can be an object or an array&lt;/p&gt;
&lt;p&gt;key: Can be a string or a number&lt;/p&gt;
&lt;p&gt;To delete any property, we can use Vue.delete as in the following code.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;app&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Counter: {{ products.id }}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; @&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;click&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;products.id++&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click Me&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myproduct &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;book&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;price&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;20.00&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;};&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#app&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               counter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               products&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myproduct
            &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
         &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;delete&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;myproduct&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;price&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;vm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         vm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$watch&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;counter&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;nval&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; oval&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Counter is incremented :&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; oval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39; to &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; nval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;!&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;In the above example, we have used Vue.delete to delete the price from the array using the following piece of code.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;delete&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;myproduct&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;price&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Following is the output, we see in the console.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/delete.jpg&quot; alt=&quot;Delete&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After deletion, we can see only the id and name as the price is deleted. We can also notice that the get/set methods are deleted.&lt;/p&gt;

&lt;h1&gt;Vue Example&lt;/h1&gt;
&lt;h2&gt;Example 1: Currency Converter&lt;/h2&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;#databinding{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            padding&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;20px&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;15px&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;15px&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            margin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;#e7e7e7;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         span&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; option&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; input &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;databinding&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Currency Converter&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;span&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Enter Amount:&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;number&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-model&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;number&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;amount&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;placeholder&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Enter Amount&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;span&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Convert From:&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;select&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-model&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;convertfrom&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;300px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;option&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-for&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;(a, index) in currencyfrom&quot;&lt;/span&gt;  &lt;span class=&quot;atn&quot;&gt;v-bind:value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;a.name&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{a.desc}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/option&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/select&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;span&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Convert To:&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;select&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-model&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;convertto&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;300px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;option&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-for&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;(a, index) in currencyfrom&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;a.name&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{a.desc}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/option&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/select&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;span&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; {{amount}} {{convertfrom}} equals {{finalamount}} {{convertto}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#databinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               currencyfrom &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;
                  &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;USD&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; desc&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;US Dollar&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
                  &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;EUR&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; desc&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Euro&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
                  &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;INR&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; desc&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Indian Rupee&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
                  &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;BHD&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; desc&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Bahraini Dinar&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               convertfrom&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;INR&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               convertto&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;USD&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               amount &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&quot;&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            computed &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               finalamount&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; to &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;convertto&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; from &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;convertfrom&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; final&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;switch&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;INR&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;to &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;USD&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                        final &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;amount &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0.016&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                     &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;to &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;EUR&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                        final &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;amount &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0.013&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                     &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;to &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;INR&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                        final &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;amount&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                     &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;to &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;BHD&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                        final &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;amount &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0.0059&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                     &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;USD&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;to &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;INR&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                        final &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;amount &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;63.88&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                     &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;to &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;EUR&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                        final &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;amount &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0.84&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                     &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;to &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;USD&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                        final &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;amount&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                     &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;to &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;BHD&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                        final &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;amount &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0.38&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                     &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;EUR&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;to &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;INR&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                        final &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;amount &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;76.22&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                     &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;to &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;USD&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                        final &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;amount &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1.19&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                     &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;to &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;EUR&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                        final &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;amount&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                     &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;to &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;BHD&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                        final &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;amount &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0.45&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                     &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;BHD&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;to &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;INR&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                        final &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;amount &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;169.44&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                     &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;to &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;USD&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                        final &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;amount &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;2.65&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                     &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;to &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;EUR&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                        final &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;amount &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;2.22&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                     &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;to &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;BHD&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                        final &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;amount&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                     &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;break&lt;/span&gt;
                  &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; final&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;Output (Conversion to USD)&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/conversion_to_usd.jpg&quot; alt=&quot;Conversion to USD&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Output: Conversion to BHD&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/conversion_to_bhd.jpg&quot; alt=&quot;Conversion to BHD&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Explanation&lt;/strong&gt;&amp;nbsp;&amp;minus; In the above example, we have created a currency converter that converts one value of currency to the selected value of other currency. We have created two dropdowns of currency. When we enter the amount to convert in the textbox, the same is displayed below after conversion. We are using the computed property to do the necessary calculation for currency conversion.&lt;/p&gt;
&lt;h2&gt;Example 2: Customer Details&lt;/h2&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VueJs Instance&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;js/vue.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;#databinding{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            padding&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;20px&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;15px&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;15px&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            margin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;25px&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         span&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; option&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; input &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Table&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            display&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; table&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;80&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Title&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            display&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; table&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;caption&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            text&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;align&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; center&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;weight&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; bold&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; larger&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Heading&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            display&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; table&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;weight&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; bold&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            text&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;align&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; center&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Row&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            display&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; table&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Cell&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            display&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; table&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;cell&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            border&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; solid&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            border&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; thin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            padding&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;5px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            padding&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;5px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;30&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;databinding&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Customer Details&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;span&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;First Name&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;placeholder&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Enter First Name&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-model&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;fname&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;span&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Last Name&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;placeholder&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Enter Last Name&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-model&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;lname&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;span&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Address&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;placeholder&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Enter Address&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-model&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;addr&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-on:click&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;showdata&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;v-bind:style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;styleobj&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Add&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;br/&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;br/&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;customercomponent&lt;/span&gt;
            &lt;span class=&quot;atn&quot;&gt;v-for&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;(item, index) in custdet&quot;&lt;/span&gt;
            &lt;span class=&quot;atn&quot;&gt;v-bind:item&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;item&quot;&lt;/span&gt;
            &lt;span class=&quot;atn&quot;&gt;v-bind:index&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;index&quot;&lt;/span&gt;
            &lt;span class=&quot;atn&quot;&gt;v-bind:itr&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;item&quot;&lt;/span&gt;
            &lt;span class=&quot;atn&quot;&gt;v-bind:key&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;item.fname&quot;&lt;/span&gt;
            &lt;span class=&quot;atn&quot;&gt;v-on:removeelement&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;custdet.splice(index, 1)&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/customercomponent&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;component&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;customercomponent&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            template &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;div class = &quot;Table&quot;&amp;gt;&amp;lt;div class = &quot;Row&quot;  v-bind:style = &quot;styleobj&quot;&amp;gt;&amp;lt;div class = &quot;Cell&quot;&amp;gt;&amp;lt;p&amp;gt;{{itr.fname}}&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;div class = &quot;Cell&quot;&amp;gt;&amp;lt;p&amp;gt;{{itr.lname}}&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;div class = &quot;Cell&quot;&amp;gt;&amp;lt;p&amp;gt;{{itr.addr}}&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;div class = &quot;Cell&quot;&amp;gt;&amp;lt;p&amp;gt;&amp;lt;button v-on:click = &quot;$emit(\&#39;removeelement\&#39;)&quot;&amp;gt;X&amp;lt;/button&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            props&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;itr&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;index&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  styleobj &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                     backgroundColor&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;getcolor&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                     fontSize &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;20&lt;/span&gt;
                  &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               getcolor &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;index &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;#FFE633&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                  &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;#D4CA87&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                  &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; vm &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Vue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            el&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#databinding&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               fname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               lname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               addr &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               custdet&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:[],&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               styleobj&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  backgroundColor&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;#2196F3!important&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  cursor&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;pointer&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  padding&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;8px 16px&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  verticalAlign&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;middle&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            methods &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               showdata &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;custdet&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                     fname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;fname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                     lname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;lname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                     addr &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;addr
                  &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;fname &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;lname &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;addr &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;Output&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/output.jpg&quot; alt=&quot;Output&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Output after deletion&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/vuejs/images/output_after_deletion.jpg&quot; alt=&quot;Output after Deletion&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Explanation&lt;/strong&gt;&amp;nbsp;&amp;minus; In the above example, we have three texboxes to enter - the First Name, Last Name and Address. There is an add button, which adds the values entered in the textboxes in a table format with a delete button.&lt;/p&gt;
&lt;p&gt;The table format is created using components. The click button interacts with the parent component using the emit event to delete the elemet from the array. The values entered are stored in the array and the same are shared with the child component using the&amp;nbsp;&lt;strong&gt;prop&lt;/strong&gt;property.&lt;/p&gt;
&lt;script&gt;mbtTOC();&lt;/script&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;http://feeds.feedburner.com/PostLinkSharing&lt;/div&gt;</description><link>https://plinksharing.blogspot.com/2021/02/learn-vue-js.html</link><author>noreply@blogger.com (Arakkha Sênâ)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1955839799848409424.post-577772612721522706</guid><pubDate>Sat, 20 Feb 2021 13:17:00 +0000</pubDate><atom:updated>2021-02-20T05:17:08.749-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">JQUERY</category><category domain="http://www.blogger.com/atom/ns#">Web Programs</category><title>Learn JQUERY</title><description>&lt;div class=&quot;mbtTOC&quot;&gt;
    &lt;button onclick=&quot;mbtToggle()&quot;&gt;Contents&lt;/button&gt;
    &lt;ol id=&quot;mbtTOC&quot;&gt;&lt;/ol&gt;
    &lt;/div&gt;
&lt;h1&gt;Introduction&lt;/h1&gt;
&lt;h2&gt;What is jQuery?&lt;/h2&gt;
&lt;p&gt;jQuery is a fast and concise JavaScript Library created by John Resig in 2006 with a nice motto:&amp;nbsp;&lt;strong&gt;Write less, do more&lt;/strong&gt;. jQuery simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is a JavaScript toolkit designed to simplify various tasks by writing less code. Here is the list of important core features supported by jQuery &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;DOM manipulation&lt;/strong&gt;&amp;nbsp;&amp;minus; The jQuery made it easy to select DOM elements, negotiate them and modifying their content by using cross-browser open source selector engine called&amp;nbsp;&lt;strong&gt;Sizzle&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Event handling&lt;/strong&gt;&amp;nbsp;&amp;minus; The jQuery offers an elegant way to capture a wide variety of events, such as a user clicking on a link, without the need to clutter the HTML code itself with event handlers.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;AJAX Support&lt;/strong&gt;&amp;nbsp;&amp;minus; The jQuery helps you a lot to develop a responsive and featurerich site using AJAX technology.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Animations&lt;/strong&gt;&amp;nbsp;&amp;minus; The jQuery comes with plenty of built-in animation effects which you can use in your websites.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Lightweight&lt;/strong&gt;&amp;nbsp;&amp;minus; The jQuery is very lightweight library - about 19KB in size (Minified and gzipped).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Cross Browser Support&lt;/strong&gt;&amp;nbsp;&amp;minus; The jQuery has cross-browser support, and works well in IE 6.0+, FF 2.0+, Safari 3.0+, Chrome and Opera 9.0+&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Latest Technology&lt;/strong&gt;&amp;nbsp;&amp;minus; The jQuery supports CSS3 selectors and basic XPath syntax.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;How to use jQuery?&lt;/h2&gt;
&lt;p&gt;There are two ways to use jQuery.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Local Installation&lt;/strong&gt;&amp;nbsp;&amp;minus; You can download jQuery library on your local machine and include it in your HTML code.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;CDN Based Version&lt;/strong&gt;&amp;nbsp;&amp;minus; You can include jQuery library into your HTML code directly from Content Delivery Network (CDN).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Local Installation&lt;/h2&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;Go to the&amp;nbsp;&lt;a href=&quot;https://jquery.com/download/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://jquery.com/download/&lt;/a&gt;&amp;nbsp;to download the latest version available.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now put downloaded&amp;nbsp;&lt;strong&gt;jquery-2.1.3.min.js&lt;/strong&gt;&amp;nbsp;file in a directory of your website, e.g. /jquery.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Now you can include&amp;nbsp;&lt;em&gt;jquery&lt;/em&gt;&amp;nbsp;library in your HTML file as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The jQuery Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/jquery/jquery-2.1.3.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Hello, World!&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Hello&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/jquery/src/hello-world.htm&quot; width=&quot;300&quot; height=&quot;150&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;CDN Based Version&lt;/h2&gt;
&lt;p&gt;You can include jQuery library into your HTML code directly from Content Delivery Network (CDN). Google and Microsoft provides content deliver for the latest version.&lt;/p&gt;
&lt;blockquote&gt;We are using Google CDN version of the library throughout this tutorial.&lt;/blockquote&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Now let us rewrite above example using jQuery library from Google CDN.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/K7aHSK&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The jQuery Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Hello, World!&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Hello&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/jquery/src/hello-world.htm&quot; width=&quot;300&quot; height=&quot;150&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;How to Call a jQuery Library Functions?&lt;/h2&gt;
&lt;p&gt;As almost everything, we do when using jQuery reads or manipulates the document object model (DOM), we need to make sure that we start adding events etc. as soon as the DOM is ready.&lt;/p&gt;
&lt;p&gt;If you want an event to work on your page, you should call it inside the $(document).ready() function. Everything inside it will load as soon as the DOM is loaded and before the page contents are loaded.&lt;/p&gt;
&lt;p&gt;To do this, we register a ready event for the document as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;$(document).ready(function() {
   // do stuff when DOM is ready
});
&lt;/pre&gt;
&lt;p&gt;To call upon any jQuery library function, use HTML script tags as shown below &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/q70PLd&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The jQuery Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;language&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;div&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Hello, world!&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);});&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;mydiv&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         Click on this to see a dialogue box.
      &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/jquery/src/hello-alert.htm&quot; width=&quot;300&quot; height=&quot;150&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;How to Use Custom Scripts?&lt;/h2&gt;
&lt;p&gt;It is better to write our custom code in the custom JavaScript file :&amp;nbsp;&lt;strong&gt;custom.js&lt;/strong&gt;, as follows &amp;minus;&lt;/p&gt;
&lt;pre id=&quot;custom_js&quot; class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;com&quot;&gt;/* Filename: custom.js */&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
$&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

   $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;div&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Hello, world!&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Now we can include&amp;nbsp;&lt;strong&gt;custom.js&lt;/strong&gt;&amp;nbsp;file in our HTML file as follows &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/CTCqTW&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; title=&quot;custom_js&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The jQuery Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/jquery/custom.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;mydiv&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         Click on this to see a dialogue box.
      &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/jquery/src/hello-alert.htm&quot; width=&quot;300&quot; height=&quot;150&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Using Multiple Libraries&lt;/h2&gt;
&lt;p&gt;You can use multiple libraries all together without conflicting each others. For example, you can use jQuery and MooTool javascript libraries together. You can check&amp;nbsp;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/jquery-noconflict.htm&quot;&gt;jQuery noConflict&lt;/a&gt;&amp;nbsp;Method for more detail.&lt;/p&gt;
&lt;h2&gt;What is Next ?&lt;/h2&gt;
&lt;p&gt;Do not worry too much if you did not understand above examples. You are going to grasp them very soon in subsequent chapters.&lt;/p&gt;
&lt;p&gt;Next chapter would try to cover few basic concepts which are coming from conventional JavaScript.&lt;/p&gt;

&lt;h1&gt;Basics&lt;/h1&gt;
&lt;p&gt;jQuery is a framework built using JavaScript capabilities. So, you can use all the functions and other capabilities available in JavaScript. This chapter would explain most basic concepts but frequently used in jQuery.&lt;/p&gt;
&lt;h2&gt;String&lt;/h2&gt;
&lt;p&gt;A string in JavaScript is an immutable object that contains none, one or many characters. Following are the valid examples of a JavaScript String &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&quot;This is JavaScript String&quot;
&#39;This is JavaScript String&#39;
&#39;This is &quot;really&quot; a JavaScript String&#39;
&quot;This is &#39;really&#39; a JavaScript String&quot;
&lt;/pre&gt;
&lt;h2&gt;Numbers&lt;/h2&gt;
&lt;p&gt;Numbers in JavaScript are double-precision 64-bit format IEEE 754 values. They are immutable, just as strings. Following are the valid examples of a JavaScript Numbers &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;5350
120.27
0.26
&lt;/pre&gt;
&lt;h2&gt;Boolean&lt;/h2&gt;
&lt;p&gt;A boolean in JavaScript can be either&amp;nbsp;&lt;strong&gt;true&lt;/strong&gt;&amp;nbsp;or&amp;nbsp;&lt;strong&gt;false&lt;/strong&gt;. If a number is zero, it defaults to false. If an empty string defaults to false.&lt;/p&gt;
&lt;p&gt;Following are the valid examples of a JavaScript Boolean &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;true      // true
false     // false
0         // false
1         // true
&quot;&quot;        // false
&quot;hello&quot;   // true
&lt;/pre&gt;
&lt;h2&gt;Objects&lt;/h2&gt;
&lt;p&gt;JavaScript supports Object concept very well. You can create an object using the object literal as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;var emp = {
   name: &quot;Zara&quot;,
   age: 10
};
&lt;/pre&gt;
&lt;p&gt;You can write and read properties of an object using the dot notation as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;// Getting object properties
emp.name  // ==&amp;gt; Zara
emp.age   // ==&amp;gt; 10

// Setting object properties
emp.name = &quot;Daisy&quot;  // &amp;lt;== Daisy
emp.age  =  20      // &amp;lt;== 20
&lt;/pre&gt;
&lt;h2&gt;Arrays&lt;/h2&gt;
&lt;p&gt;You can define arrays using the array literal as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;var x = [];
var y = [1, 2, 3, 4, 5];
&lt;/pre&gt;
&lt;p&gt;An array has a&amp;nbsp;&lt;strong&gt;length&lt;/strong&gt;&amp;nbsp;property that is useful for iteration &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; x &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;];&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; i &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; i &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; x&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; i&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;++)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;com&quot;&gt;// Do something with x[i]&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;Functions&lt;/h2&gt;
&lt;p&gt;A function in JavaScript can be either named or anonymous. A named function can be defined using&amp;nbsp;&lt;em&gt;function&lt;/em&gt;&amp;nbsp;keyword as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; named&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(){&lt;/span&gt;
   &lt;span class=&quot;com&quot;&gt;// do some stuff here&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;An anonymous function can be defined in similar way as a normal function but it would not have any name.&lt;/p&gt;
&lt;p&gt;A anonymous function can be assigned to a variable or passed to a method as shown below.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; handler &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(){&lt;/span&gt;
   &lt;span class=&quot;com&quot;&gt;// do some stuff here&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;JQuery makes a use of anonymous functions very frequently as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(){&lt;/span&gt;
   &lt;span class=&quot;com&quot;&gt;// do some stuff here&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;Arguments&lt;/h2&gt;
&lt;p&gt;JavaScript variable&amp;nbsp;&lt;em&gt;arguments&lt;/em&gt;&amp;nbsp;is a kind of array which has&amp;nbsp;&lt;em&gt;length&lt;/em&gt;&amp;nbsp;property. Following example explains it very well &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; func&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;typeof&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; x&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; arguments&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

func&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;                &lt;span class=&quot;com&quot;&gt;//==&amp;gt; &quot;undefined&quot;, 0&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
func&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;               &lt;span class=&quot;com&quot;&gt;//==&amp;gt; &quot;number&quot;, 1&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
func&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;1&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;2&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;3&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;   &lt;span class=&quot;com&quot;&gt;//==&amp;gt; &quot;string&quot;, 3&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The arguments object also has a&amp;nbsp;&lt;em&gt;callee&lt;/em&gt;&amp;nbsp;property, which refers to the function you&#39;re inside of. For example &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; func&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; arguments&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;callee&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt; 
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

func&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;                &lt;span class=&quot;com&quot;&gt;// ==&amp;gt; func&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;Context&lt;/h2&gt;
&lt;p&gt;JavaScript famous keyword&amp;nbsp;&lt;strong&gt;this&lt;/strong&gt;&amp;nbsp;always refers to the current context. Within a function&amp;nbsp;&lt;strong&gt;this&lt;/strong&gt;&amp;nbsp;context can change, depending on how the function is called &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;com&quot;&gt;// this refers to window.document&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

$&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;div&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;com&quot;&gt;// this refers to a div DOM element&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;You can specify the context for a function call using the function-built-in methods&amp;nbsp;&lt;strong&gt;call()&lt;/strong&gt;and&amp;nbsp;&lt;strong&gt;apply()&lt;/strong&gt;&amp;nbsp;methods.&lt;/p&gt;
&lt;p&gt;The difference between them is how they pass arguments. Call passes all arguments through as arguments to the function, while apply accepts an array as the arguments.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; scope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; arguments&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

scope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;// window, 0&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
scope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;call&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;foobar&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]);&lt;/span&gt;  &lt;span class=&quot;com&quot;&gt;//==&amp;gt; &quot;foobar&quot;, 1&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
scope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;apply&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;foobar&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]);&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;//==&amp;gt; &quot;foobar&quot;, 2&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;Scope&lt;/h2&gt;
&lt;p&gt;The scope of a variable is the region of your program in which it is defined. JavaScript variable will have only two scopes.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Global Variables&lt;/strong&gt;&amp;nbsp;&amp;minus; A global variable has global scope which means it is defined everywhere in your JavaScript code.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Local Variables&lt;/strong&gt;&amp;nbsp;&amp;minus; A local variable will be visible only within a function where it is defined. Function parameters are always local to that function.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Within the body of a function, a local variable takes precedence over a global variable with the same name &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myVar &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;global&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;     &lt;span class=&quot;com&quot;&gt;// ==&amp;gt; Declare a global variable&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myVar &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;local&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;   &lt;span class=&quot;com&quot;&gt;// ==&amp;gt; Declare a local variable&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;myVar&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;// ==&amp;gt; local&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;Callback&lt;/h2&gt;
&lt;p&gt;A callback is a plain JavaScript function passed to some method as an argument or option. Some callbacks are just events, called to give the user a chance to react when a certain state is triggered.&lt;/p&gt;
&lt;p&gt;jQuery&#39;s event system uses such callbacks everywhere for example &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;body&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;clicked: &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;target&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Most callbacks provide arguments and a context. In the event-handler example, the callback is called with one argument, an Event.&lt;/p&gt;
&lt;p&gt;Some callbacks are required to return something, others make that return value optional. To prevent a form submission, a submit event handler can return false as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;$(&quot;#myform&quot;).submit(function() {
   return false;
});
&lt;/pre&gt;
&lt;h2&gt;Closures&lt;/h2&gt;
&lt;p&gt;Closures are created whenever a variable that is defined outside the current scope is accessed from within some inner scope.&lt;/p&gt;
&lt;p&gt;Following example shows how the variable&amp;nbsp;&lt;strong&gt;counter&lt;/strong&gt;&amp;nbsp;is visible within the create, increment, and print functions, but not outside of them &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; create&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; counter &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
	
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      increment&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         counter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;++;&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
	   &lt;span class=&quot;kwd&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;counter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; c &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; create&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
c&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;increment&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
c&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;     &lt;span class=&quot;com&quot;&gt;// ==&amp;gt; 1&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This pattern allows you to create objects with methods that operate on data that isn&#39;t visible to the outside world. It should be noted that&amp;nbsp;&lt;strong&gt;data hiding&lt;/strong&gt;&amp;nbsp;is the very basis of object-oriented programming.&lt;/p&gt;
&lt;h2&gt;Proxy Pattern&lt;/h2&gt;
&lt;p&gt;A proxy is an object that can be used to control access to another object. It implements the same interface as this other object and passes on any method invocations to it. This other object is often called the real subject.&lt;/p&gt;
&lt;p&gt;A proxy can be instantiated in place of this real subject and allow it to be accessed remotely. We can saves jQuery&#39;s setArray method in a closure and overwrites it as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;com&quot;&gt;// log all calls to setArray&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; proxied &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; jQuery&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;fn&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;setArray&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

   jQuery&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;fn&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;setArray &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; arguments&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; proxied&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;apply&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; arguments&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;};&lt;/span&gt;
	
&lt;span class=&quot;pun&quot;&gt;})();&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The above wraps its code in a function to hide the&amp;nbsp;&lt;em&gt;proxied&lt;/em&gt;&amp;nbsp;variable. The proxy then logs all calls to the method and delegates the call to the original method. Using&amp;nbsp;&lt;em&gt;apply(this, arguments)&lt;/em&gt;&amp;nbsp;guarantees that the caller won&#39;t be able to notice the difference between the original and the proxied method.&lt;/p&gt;
&lt;h2&gt;Built-in Functions&lt;/h2&gt;
&lt;p&gt;JavaScript comes along with a useful set of built-in functions. These methods can be used to manipulate Strings, Numbers and Dates.&lt;/p&gt;
&lt;p&gt;Following are important JavaScript functions &amp;minus;&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th width=&quot;10%&quot;&gt;Sr.No.&lt;/th&gt;
&lt;th&gt;Method &amp;amp; Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;1&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;charAt()&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Returns the character at the specified index.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;2&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;concat()&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Combines the text of two strings and returns a new string.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;3&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;forEach()&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Calls a function for each element in the array.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;4&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;indexOf()&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Returns the index within the calling String object of the first occurrence of the specified value, or -1 if not found.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;5&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;length()&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Returns the length of the string.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;6&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;pop()&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Removes the last element from an array and returns that element.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;7&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;push()&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Adds one or more elements to the end of an array and returns the new length of the array.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;8&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;reverse()&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Reverses the order of the elements of an array -- the first becomes the last, and the last becomes the first.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;9&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;sort()&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Sorts the elements of an array.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;10&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;substr()&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Returns the characters in a string beginning at the specified location through the specified number of characters.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;11&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;toLowerCase()&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Returns the calling string value converted to lower case.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;12&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;toString()&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Returns the string representation of the number&#39;s value.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;13&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;toUpperCase()&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Returns the calling string value converted to uppercase.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;The Document Object Model&lt;/h2&gt;
&lt;p&gt;The Document Object Model is a tree structure of various elements of HTML as follows &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/s1QZ3X&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The jQuery Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is a paragraph.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is second paragraph.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is third paragraph.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/jquery/src/sample-html-code.htm&quot; width=&quot;300&quot; height=&quot;150&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;Following are the important points about the above tree structure &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;The &amp;lt;html&amp;gt; is the ancestor of all the other elements; in other words, all the other elements are descendants of &amp;lt;html&amp;gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The &amp;lt;head&amp;gt; and &amp;lt;body&amp;gt; elements are not only descendants, but children of &amp;lt;html&amp;gt;, as well.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Likewise, in addition to being the ancestor of &amp;lt;head&amp;gt; and &amp;lt;body&amp;gt;, &amp;lt;html&amp;gt; is also their parent.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The &amp;lt;p&amp;gt; elements are children (and descendants) of &amp;lt;div&amp;gt;, descendants of &amp;lt;body&amp;gt; and &amp;lt;html&amp;gt;, and siblings of each other &amp;lt;p&amp;gt; elements.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;While learning jQuery concepts, it will be helpful to have understanding on DOM, if you are not aware of DOM then I would suggest to go through our simple tutorial on&amp;nbsp;&lt;a href=&quot;https://www.tutorialspoint.com/dom/index.htm&quot; target=&quot;_blank&quot;&gt;DOM Tutorial&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;Selectors&lt;/h1&gt;
&lt;p&gt;The jQuery library harnesses the power of Cascading Style Sheets (CSS) selectors to let us quickly and easily access elements or groups of elements in the Document Object Model (DOM).&lt;/p&gt;
&lt;p&gt;A jQuery Selector is a function which makes use of expressions to find out matching elements from a DOM based on the given criteria. Simply you can say, selectors are used to select one or more HTML elements using jQuery. Once an element is selected then we can perform various operations on that selected element.&lt;/p&gt;
&lt;h2&gt;The $() factory function&lt;/h2&gt;
&lt;p&gt;jQuery selectors start with the dollar sign and parentheses &amp;minus;&amp;nbsp;&lt;strong&gt;$()&lt;/strong&gt;. The factory function&amp;nbsp;&lt;strong&gt;$()&lt;/strong&gt;makes use of following three building blocks while selecting elements in a given document &amp;minus;&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th width=&quot;10%&quot;&gt;Sr.No.&lt;/th&gt;
&lt;th&gt;Selector &amp;amp; Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;1&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;Tag Name&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Represents a tag name available in the DOM. For example&amp;nbsp;&lt;strong&gt;$(&#39;p&#39;)&lt;/strong&gt;&amp;nbsp;selects all paragraphs &amp;lt;p&amp;gt; in the document.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;2&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;Tag ID&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Represents a tag available with the given ID in the DOM. For example&amp;nbsp;&lt;strong&gt;$(&#39;#some-id&#39;)&lt;/strong&gt;&amp;nbsp;selects the single element in the document that has an ID of some-id.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;3&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;Tag Class&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Represents a tag available with the given class in the DOM. For example&amp;nbsp;&lt;strong&gt;$(&#39;.some-class&#39;)&lt;/strong&gt;&amp;nbsp;selects all elements in the document that have a class of some-class.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;All the above items can be used either on their own or in combination with other selectors. All the jQuery selectors are based on the same principle except some tweaking.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;&amp;nbsp;&amp;minus; The factory function&amp;nbsp;&lt;strong&gt;$()&lt;/strong&gt;&amp;nbsp;is a synonym of&amp;nbsp;&lt;strong&gt;jQuery()&lt;/strong&gt;&amp;nbsp;function. So in case you are using any other JavaScript library where&amp;nbsp;&lt;strong&gt;$&lt;/strong&gt;&amp;nbsp;sign is conflicting with some thing else then you can replace&amp;nbsp;&lt;strong&gt;$&lt;/strong&gt;&amp;nbsp;sign by&amp;nbsp;&lt;strong&gt;jQuery&lt;/strong&gt;&amp;nbsp;name and you can use function&amp;nbsp;&lt;strong&gt;jQuery()&lt;/strong&gt;&amp;nbsp;instead of&amp;nbsp;&lt;strong&gt;$()&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Following is a simple example which makes use of Tag Selector. This would select all the elements with a tag name&amp;nbsp;&lt;strong&gt;p&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/lks5At&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The jQuery Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;language&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;p&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;background-color&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;yellow&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;myclass&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is a paragraph.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;myid&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is second paragraph.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is third paragraph.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/jquery/src/jquery-selectors.htm&quot; width=&quot;300&quot; height=&quot;150&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;How to Use Selectors?&lt;/h2&gt;
&lt;p&gt;The selectors are very useful and would be required at every step while using jQuery. They get the exact element that you want from your HTML document.&lt;/p&gt;
&lt;p&gt;Following table lists down few basic selectors and explains them with examples.&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th width=&quot;10%&quot;&gt;Sr.No.&lt;/th&gt;
&lt;th&gt;Selector &amp;amp; Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;1&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/selector-element-name.htm&quot;&gt;Name&lt;/a&gt;
&lt;p&gt;Selects all elements which match with the given element&amp;nbsp;&lt;strong&gt;Name&lt;/strong&gt;.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;2&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/selector-element-id.htm&quot;&gt;#ID&lt;/a&gt;
&lt;p&gt;Selects a single element which matches with the given&amp;nbsp;&lt;strong&gt;ID&lt;/strong&gt;.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;3&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/selector-element-class.htm&quot;&gt;.Class&lt;/a&gt;
&lt;p&gt;Selects all elements which match with the given&amp;nbsp;&lt;strong&gt;Class&lt;/strong&gt;.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;4&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/selector-universal.htm&quot;&gt;Universal (*)&lt;/a&gt;
&lt;p&gt;Selects all elements available in a DOM.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;5&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/selector-multiple-elements.htm&quot;&gt;Multiple Elements E, F, G&lt;/a&gt;
&lt;p&gt;Selects the combined results of all the specified selectors&amp;nbsp;&lt;strong&gt;E, F&lt;/strong&gt;&amp;nbsp;or&amp;nbsp;&lt;strong&gt;G&lt;/strong&gt;.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Selectors Examples&lt;/h2&gt;
&lt;p&gt;Similar to above syntax and examples, following examples would give you understanding on using different type of other useful selectors &amp;minus;&lt;/p&gt;
&lt;section class=&quot;toggle&quot;&gt;&lt;label&gt;Here, you have different type of other useful selectors &amp;minus;&lt;/label&gt;&lt;/section&gt;
&lt;p&gt;You can use all the above selectors with any HTML/XML element in generic way. For example if selector&amp;nbsp;&lt;strong&gt;$(&quot;li:first&quot;)&lt;/strong&gt;&amp;nbsp;works for &amp;lt;li&amp;gt; element then&amp;nbsp;&lt;strong&gt;$(&quot;p:first&quot;)&lt;/strong&gt;&amp;nbsp;would also work for &amp;lt;p&amp;gt; element.&lt;/p&gt;

&lt;h1&gt;Attributes&lt;/h1&gt;
&lt;p&gt;Some of the most basic components we can manipulate when it comes to DOM elements are the properties and attributes assigned to those elements.&lt;/p&gt;
&lt;p&gt;Most of these attributes are available through JavaScript as DOM node properties. Some of the more common properties are &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;className&lt;/li&gt;
&lt;li&gt;tagName&lt;/li&gt;
&lt;li&gt;id&lt;/li&gt;
&lt;li&gt;href&lt;/li&gt;
&lt;li&gt;title&lt;/li&gt;
&lt;li&gt;rel&lt;/li&gt;
&lt;li&gt;src&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Consider the following HTML markup for an image element &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&amp;lt;img id = &quot;imageid&quot; src = &quot;image.gif&quot; alt = &quot;Image&quot; class = &quot;myclass&quot; 
   title = &quot;This is an image&quot;/&amp;gt;
&lt;/pre&gt;
&lt;p&gt;In this element&#39;s markup, the tag name is img, and the markup for id, src, alt, class, and title represents the element&#39;s attributes, each of which consists of a name and a value.&lt;/p&gt;
&lt;p&gt;jQuery gives us the means to easily manipulate an element&#39;s attributes and gives us access to the element so that we can also change its properties.&lt;/p&gt;
&lt;h2&gt;Get Attribute Value&lt;/h2&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;attr()&lt;/strong&gt;&amp;nbsp;method can be used to either fetch the value of an attribute from the first element in the matched set or set attribute values onto all matched elements.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Following is a simple example which fetches title attribute of &amp;lt;em&amp;gt; tag and set &amp;lt;div id = &quot;divid&quot;&amp;gt; value with the same value &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/h16fH2&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The jQuery Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;language&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; title &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;em&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;attr&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;title&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;#divid&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;em&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;title&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Bold and Brave&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is first paragraph.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/em&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;myid&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is second paragraph.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;divid&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/jquery/src/get-attribute-value.htm&quot; width=&quot;300&quot; height=&quot;150&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Set Attribute Value&lt;/h2&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;attr(name, value)&lt;/strong&gt;&amp;nbsp;method can be used to set the named attribute onto all elements in the wrapped set using the passed value.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Following is a simple example which set&amp;nbsp;&lt;strong&gt;src&lt;/strong&gt;&amp;nbsp;attribute of an image tag to a correct location &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/944kkG&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The jQuery Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;base&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;https://www.tutorialspoint.com&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;language&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;#myimg&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;attr&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;src&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;/jquery/images/jquery.jpg&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;myimg&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/images/jquery.jpg&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;alt&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Sample image&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/jquery/src/set-attribute-value.htm&quot; width=&quot;300&quot; height=&quot;150&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Applying Styles&lt;/h2&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;addClass( classes )&lt;/strong&gt;&amp;nbsp;method can be used to apply defined style sheets onto all the matched elements. You can specify multiple classes separated by space.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Following is a simple example which sets&amp;nbsp;&lt;strong&gt;class&lt;/strong&gt;&amp;nbsp;attribute of a para &amp;lt;p&amp;gt; tag &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/VtpTcP&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The jQuery Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;language&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;em&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;addClass&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;selected&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;#myid&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;addClass&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;highlight&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;selected &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;red&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;highlight &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;yellow&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;em&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;title&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Bold and Brave&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is first paragraph.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/em&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;myid&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is second paragraph.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/jquery/src/applying-styles.htm&quot; width=&quot;300&quot; height=&quot;150&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Attribute Methods&lt;/h2&gt;
&lt;p&gt;Following table lists down few useful methods which you can use to manipulate attributes and properties &amp;minus;&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th width=&quot;10%&quot;&gt;Sr.No.&lt;/th&gt;
&lt;th&gt;Methods &amp;amp; Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;1&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/attr-properties.htm&quot;&gt;attr( properties )&lt;/a&gt;
&lt;p&gt;Set a key/value object as properties to all matched elements.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;2&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/attr-key-function.htm&quot;&gt;attr( key, fn )&lt;/a&gt;
&lt;p&gt;Set a single property to a computed value, on all matched elements.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;3&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/attr-remove-attribute.htm&quot;&gt;removeAttr( name )&lt;/a&gt;
&lt;p&gt;Remove an attribute from each of the matched elements.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;4&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/attr-has-class.htm&quot;&gt;hasClass( class )&lt;/a&gt;
&lt;p&gt;Returns true if the specified class is present on at least one of the set of matched elements.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;5&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/attr-remove-class.htm&quot;&gt;removeClass( class )&lt;/a&gt;
&lt;p&gt;Removes all or the specified class(es) from the set of matched elements.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;6&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/attr-toggle-class.htm&quot;&gt;toggleClass( class )&lt;/a&gt;
&lt;p&gt;Adds the specified class if it is not present, removes the specified class if it is present.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;7&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/attr-html.htm&quot;&gt;html( )&lt;/a&gt;
&lt;p&gt;Get the html contents (innerHTML) of the first matched element.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;8&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/attr-html-val.htm&quot;&gt;html( val )&lt;/a&gt;
&lt;p&gt;Set the html contents of every matched element.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;9&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/attr-text.htm&quot;&gt;text( )&lt;/a&gt;
&lt;p&gt;Get the combined text contents of all matched elements.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;10&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/attr-text-val.htm&quot;&gt;text( val )&lt;/a&gt;
&lt;p&gt;Set the text contents of all matched elements.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;11&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/attr-val.htm&quot;&gt;val( )&lt;/a&gt;
&lt;p&gt;Get the input value of the first matched element.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;12&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/attr-val-val.htm&quot;&gt;val( val )&lt;/a&gt;
&lt;p&gt;Set the value attribute of every matched element if it is called on &amp;lt;input&amp;gt; but if it is called on &amp;lt;select&amp;gt; with the passed &amp;lt;option&amp;gt; value then passed option would be selected, if it is called on check box or radio box then all the matching check box and radiobox would be checked.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Examples&lt;/h2&gt;
&lt;p&gt;Similar to above syntax and examples, following examples would give you understanding on using various attribute methods in different situation &amp;minus;&lt;/p&gt;
&lt;section class=&quot;toggle&quot;&gt;&lt;label&gt;Here is a complete list of attribute methods in different situation &amp;minus;&lt;/label&gt;&lt;/section&gt;

&lt;h1&gt;CSS&lt;/h1&gt;
&lt;p&gt;The jQuery library supports nearly all of the selectors included in Cascading Style Sheet (CSS) specifications 1 through 3, as outlined on the World Wide Web Consortium&#39;s site.&lt;/p&gt;
&lt;p&gt;Using JQuery library developers can enhance their websites without worrying about browsers and their versions as long as the browsers have JavaScript enabled.&lt;/p&gt;
&lt;p&gt;Most of the JQuery CSS Methods do not modify the content of the jQuery object and they are used to apply CSS properties on DOM elements.&lt;/p&gt;
&lt;h2&gt;Apply CSS Properties&lt;/h2&gt;
&lt;p&gt;This is very simple to apply any CSS property using JQuery method&amp;nbsp;&lt;strong&gt;css( PropertyName, PropertyValue )&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Here is the syntax for the method &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&lt;strong&gt;selector&lt;/strong&gt;.css( PropertyName, PropertyValue );
&lt;/pre&gt;
&lt;p&gt;Here you can pass&amp;nbsp;&lt;em&gt;PropertyName&lt;/em&gt;&amp;nbsp;as a javascript string and based on its value,&amp;nbsp;&lt;em&gt;PropertyValue&lt;/em&gt;&amp;nbsp;could be string or integer.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Following is an example which adds font color to the second list item.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/EnTnzO&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The jQuery Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;language&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;li&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;eq&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;color&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;red&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;list item 1&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;list item 2&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;list item 3&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;list item 4&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;list item 5&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;list item 6&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/jquery/src/apply-css-properties.htm&quot; width=&quot;300&quot; height=&quot;150&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Apply Multiple CSS Properties&lt;/h2&gt;
&lt;p&gt;You can apply multiple CSS properties using a single JQuery method&amp;nbsp;&lt;strong&gt;CSS( {key1:val1, key2:val2....)&lt;/strong&gt;. You can apply as many properties as you like in a single call.&lt;/p&gt;
&lt;p&gt;Here is the syntax for the method &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&lt;strong&gt;selector&lt;/strong&gt;.css( {key1:val1, key2:val2....keyN:valN})
&lt;/pre&gt;
&lt;p&gt;Here you can pass key as property and val as its value as described above.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Following is an example which adds font color as well as background color to the second list item.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/OpezJD&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The jQuery Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;language&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;li&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;eq&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;color&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;red&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;background-color&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;green&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;list item 1&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;list item 2&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;list item 3&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;list item 4&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;list item 5&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;list item 6&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/jquery/src/apply-css-multiple-properties.htm&quot; width=&quot;300&quot; height=&quot;150&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Setting Element Width &amp;amp; Height&lt;/h2&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;width( val )&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;height( val )&lt;/strong&gt;&amp;nbsp;method can be used to set the width and height respectively of any element.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Following is a simple example which sets the width of first division element where as rest of the elements have width set by style sheet&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/zhko8T&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The jQuery Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;language&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;div:first&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;div:first&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;background-color&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;blue&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         div &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
            width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;70px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; height&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;50px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
            margin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;5px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;red&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; cursor&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;pointer&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt; 
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/jquery/src/setting-element-height-width.htm&quot; width=&quot;300&quot; height=&quot;150&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;JQuery CSS Methods&lt;/h2&gt;
&lt;p&gt;Following table lists down all the methods which you can use to play with CSS properties &amp;minus;&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th width=&quot;10%&quot;&gt;Sr.No.&lt;/th&gt;
&lt;th&gt;Method &amp;amp; Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;1&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/css-name.htm&quot;&gt;css( name )&lt;/a&gt;
&lt;p&gt;Return a style property on the first matched element.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;2&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/css-name-value.htm&quot;&gt;css( name, value )&lt;/a&gt;
&lt;p&gt;Set a single style property to a value on all matched elements.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;3&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/css-properties.htm&quot;&gt;css( properties )&lt;/a&gt;
&lt;p&gt;Set a key/value object as style properties to all matched elements.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;4&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/css-height-val.htm&quot;&gt;height( val )&lt;/a&gt;
&lt;p&gt;Set the CSS height of every matched element.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;5&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/css-height.htm&quot;&gt;height( )&lt;/a&gt;
&lt;p&gt;Get the current computed, pixel, height of the first matched element.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;6&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/css-innerheight.htm&quot;&gt;innerHeight( )&lt;/a&gt;
&lt;p&gt;Gets the inner height (excludes the border and includes the padding) for the first matched element.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;7&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/css-innerwidth.htm&quot;&gt;innerWidth( )&lt;/a&gt;
&lt;p&gt;Gets the inner width (excludes the border and includes the padding) for the first matched element.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;8&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/css-offset.htm&quot;&gt;offset( )&lt;/a&gt;
&lt;p&gt;Get the current offset of the first matched element, in pixels, relative to the document.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;9&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/css-offsetparent.htm&quot;&gt;offsetParent( )&lt;/a&gt;
&lt;p&gt;Returns a jQuery collection with the positioned parent of the first matched element.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;10&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/css-outerheight.htm&quot;&gt;outerHeight( [margin] )&lt;/a&gt;
&lt;p&gt;Gets the outer height (includes the border and padding by default) for the first matched element.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;11&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/css-outerwidth.htm&quot;&gt;outerWidth( [margin] )&lt;/a&gt;
&lt;p&gt;Get the outer width (includes the border and padding by default) for the first matched element.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;12&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/css-position.htm&quot;&gt;position( )&lt;/a&gt;
&lt;p&gt;Gets the top and left position of an element relative to its offset parent.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;13&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/css-scrollleft-val.htm&quot;&gt;scrollLeft( val )&lt;/a&gt;
&lt;p&gt;When a value is passed in, the scroll left offset is set to that value on all matched elements.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;14&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/css-scrollleft.htm&quot;&gt;scrollLeft( )&lt;/a&gt;
&lt;p&gt;Gets the scroll left offset of the first matched element.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;15&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/css-scrolltop-val.htm&quot;&gt;scrollTop( val )&lt;/a&gt;
&lt;p&gt;When a value is passed in, the scroll top offset is set to that value on all matched elements.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;16&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/css-scrolltop.htm&quot;&gt;scrollTop( )&lt;/a&gt;
&lt;p&gt;Gets the scroll top offset of the first matched element.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;17&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/css-width-val.htm&quot;&gt;width( val )&lt;/a&gt;
&lt;p&gt;Set the CSS width of every matched element.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;18&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/css-width.htm&quot;&gt;width( )&lt;/a&gt;
&lt;p&gt;Get the current computed, pixel, width of the first matched element.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;h1&gt;DOM&lt;/h1&gt;
&lt;p&gt;JQuery provides methods to manipulate DOM in efficient way. You do not need to write big code to modify the value of any element&#39;s attribute or to extract HTML code from a paragraph or division.&lt;/p&gt;
&lt;p&gt;JQuery provides methods such as .attr(), .html(), and .val() which act as getters, retrieving information from DOM elements for later use.&lt;/p&gt;
&lt;h2&gt;Content Manipulation&lt;/h2&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;html( )&lt;/strong&gt;&amp;nbsp;method gets the html contents (innerHTML) of the first matched element.&lt;/p&gt;
&lt;p&gt;Here is the syntax for the method &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&lt;em&gt;selector&lt;/em&gt;.html( )
&lt;/pre&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Following is an example which makes use of .html() and .text(val) methods. Here .html() retrieves HTML content from the object and then .text( val ) method sets value of the object using passed parameter &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/E4Iztt&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The jQuery Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;language&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;div&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; content &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;#result&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; content &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;#division{ margin:10px;padding:12px; border:2px solid #666; width:60px;}&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click on the square below:&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;result&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;division&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;blue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         This is Blue Square!!
      &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/jquery/src/content-manipulation.htm&quot; width=&quot;300&quot; height=&quot;150&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;DOM Element Replacement&lt;/h2&gt;
&lt;p&gt;You can replace a complete DOM element with the specified HTML or DOM elements. The&amp;nbsp;&lt;strong&gt;replaceWith( content )&lt;/strong&gt;&amp;nbsp;method serves this purpose very well.&lt;/p&gt;
&lt;p&gt;Here is the syntax for the method &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&lt;em&gt;selector&lt;/em&gt;.replaceWith( content )
&lt;/pre&gt;
&lt;p&gt;Here content is what you want to have instead of original element. This could be HTML or simple text.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Following is an example which would replace division element with &quot;&amp;lt;h1&amp;gt;JQuery is Great &amp;lt;/h1&amp;gt;&quot; &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/Cz8IQx&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The jQuery Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;language&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;div&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;replaceWith&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;h1&amp;gt;JQuery is Great&amp;lt;/h1&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;#division{ margin:10px;padding:12px; border:2px solid #666; width:60px;}&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click on the square below:&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;result&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;division&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;blue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         This is Blue Square!!
      &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/jquery/src/dom-element-replacement.htm&quot; width=&quot;300&quot; height=&quot;150&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Removing DOM Elements&lt;/h2&gt;
&lt;p&gt;There may be a situation when you would like to remove one or more DOM elements from the document. JQuery provides two methods to handle the situation.&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;empty( )&lt;/strong&gt;&amp;nbsp;method remove all child nodes from the set of matched elements where as the method&amp;nbsp;&lt;strong&gt;remove( expr )&lt;/strong&gt;&amp;nbsp;method removes all matched elements from the DOM.&lt;/p&gt;
&lt;p&gt;Here is the syntax for the method &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&lt;em&gt;selector&lt;/em&gt;.remove( [ expr ])

or 

&lt;em&gt;selector&lt;/em&gt;.empty( )
&lt;/pre&gt;
&lt;p&gt;You can pass optional parameter&amp;nbsp;&lt;em&gt;expr&lt;/em&gt;&amp;nbsp;to filter the set of elements to be removed.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Following is an example where elements are being removed as soon as they are clicked &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/qPcrSW&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The jQuery Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;language&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;div&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;remove&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; margin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;12px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;2px&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; solid &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;#666; width:60px;}&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click on any square below:&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;result&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;div&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;blue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;div&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;green&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;div&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;red&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/jquery/src/removing-dom-elements.htm&quot; width=&quot;300&quot; height=&quot;150&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Inserting DOM Elements&lt;/h2&gt;
&lt;p&gt;There may be a situation when you would like to insert new one or more DOM elements in your existing document. JQuery provides various methods to insert elements at various locations.&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;after( content )&lt;/strong&gt;&amp;nbsp;method insert content after each of the matched elements where as the method&amp;nbsp;&lt;strong&gt;before( content )&lt;/strong&gt;&amp;nbsp;method inserts content before each of the matched elements.&lt;/p&gt;
&lt;p&gt;Here is the syntax for the method &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&lt;em&gt;selector&lt;/em&gt;.after( content )

or

&lt;em&gt;selector&lt;/em&gt;.before( content )
&lt;/pre&gt;
&lt;p&gt;Here content is what you want to insert. This could be HTML or simple text.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Following is an example where &amp;lt;div&amp;gt; elements are being inserted just before the clicked element &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/8xBSnA&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The jQuery Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;language&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;div&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;before&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;div class=&quot;div&quot;&amp;gt;&amp;lt;/div&amp;gt;&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; margin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;12px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;2px&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; solid &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;#666; width:60px;}&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click on any square below:&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;result&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;div&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;blue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;div&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;green&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;div&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;red&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/jquery/src/inserting-dom-elements.htm&quot; width=&quot;300&quot; height=&quot;150&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;DOM Manipulation Methods&lt;/h2&gt;
&lt;p&gt;Following table lists down all the methods which you can use to manipulate DOM elements &amp;minus;&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th width=&quot;10%&quot;&gt;Sr.No.&lt;/th&gt;
&lt;th&gt;Method &amp;amp; Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;1&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/dom-after.htm&quot;&gt;after( content )&lt;/a&gt;
&lt;p&gt;Insert content after each of the matched elements.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;2&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/dom-append.htm&quot;&gt;append( content )&lt;/a&gt;
&lt;p&gt;Append content to the inside of every matched element.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;3&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/dom-appendto.htm&quot;&gt;appendTo( selector )&lt;/a&gt;
&lt;p&gt;Append all of the matched elements to another, specified, set of elements.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;4&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/dom-before.htm&quot;&gt;before( content )&lt;/a&gt;
&lt;p&gt;Insert content before each of the matched elements.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;5&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/dom-clone-bool.htm&quot;&gt;clone( bool )&lt;/a&gt;
&lt;p&gt;Clone matched DOM Elements, and all their event handlers, and select the clones.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;6&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/dom-clone.htm&quot;&gt;clone( )&lt;/a&gt;
&lt;p&gt;Clone matched DOM Elements and select the clones.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;7&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/dom-empty.htm&quot;&gt;empty( )&lt;/a&gt;
&lt;p&gt;Remove all child nodes from the set of matched elements.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;8&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/dom-html-val.htm&quot;&gt;html( val )&lt;/a&gt;
&lt;p&gt;Set the html contents of every matched element.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;9&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/dom-html.htm&quot;&gt;html( )&lt;/a&gt;
&lt;p&gt;Get the html contents (innerHTML) of the first matched element.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;10&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/dom-insertafter.htm&quot;&gt;insertAfter( selector )&lt;/a&gt;
&lt;p&gt;Insert all of the matched elements after another, specified, set of elements.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;11&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/dom-insertbefore.htm&quot;&gt;insertBefore( selector )&lt;/a&gt;
&lt;p&gt;Insert all of the matched elements before another, specified, set of elements.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;12&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/dom-prepend.htm&quot;&gt;prepend( content )&lt;/a&gt;
&lt;p&gt;Prepend content to the inside of every matched element.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;13&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/dom-prependto.htm&quot;&gt;prependTo( selector )&lt;/a&gt;
&lt;p&gt;Prepend all of the matched elements to another, specified, set of elements.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;14&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/dom-remove-expr.htm&quot;&gt;remove( expr )&lt;/a&gt;
&lt;p&gt;Removes all matched elements from the DOM.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;15&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/dom-replaceall.htm&quot;&gt;replaceAll( selector )&lt;/a&gt;
&lt;p&gt;Replaces the elements matched by the specified selector with the matched elements.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;16&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/dom-replacewith.htm&quot;&gt;replaceWith( content )&lt;/a&gt;
&lt;p&gt;Replaces all matched elements with the specified HTML or DOM elements.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;17&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/dom-text-val.htm&quot;&gt;text( val )&lt;/a&gt;
&lt;p&gt;Set the text contents of all matched elements.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;18&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/dom-text.htm&quot;&gt;text( )&lt;/a&gt;
&lt;p&gt;Get the combined text contents of all matched elements.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;19&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/dom-wrap-elem.htm&quot;&gt;wrap( elem )&lt;/a&gt;
&lt;p&gt;Wrap each matched element with the specified element.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;20&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/dom-wrap-html.htm&quot;&gt;wrap( html )&lt;/a&gt;
&lt;p&gt;Wrap each matched element with the specified HTML content.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;21&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/dom-wrapall-elem.htm&quot;&gt;wrapAll( elem )&lt;/a&gt;
&lt;p&gt;Wrap all the elements in the matched set into a single wrapper element.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;22&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/dom-wrapall-html.htm&quot;&gt;wrapAll( html )&lt;/a&gt;
&lt;p&gt;Wrap all the elements in the matched set into a single wrapper element.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;23&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/dom-wrapinner-elem.htm&quot;&gt;wrapInner( elem )&lt;/a&gt;
&lt;p&gt;Wrap the inner child contents of each matched element (including text nodes) with a DOM element.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;24&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/dom-wrapinner-html.htm&quot;&gt;wrapInner( html )&lt;/a&gt;
&lt;p&gt;Wrap the inner child contents of each matched element (including text nodes) with an HTML structure.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;h1&gt;Events&lt;/h1&gt;
&lt;p&gt;We have the ability to create dynamic web pages by using events. Events are actions that can be detected by your Web Application.&lt;/p&gt;
&lt;p&gt;Following are the examples events &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;A mouse click&lt;/li&gt;
&lt;li&gt;A web page loading&lt;/li&gt;
&lt;li&gt;Taking mouse over an element&lt;/li&gt;
&lt;li&gt;Submitting an HTML form&lt;/li&gt;
&lt;li&gt;A keystroke on your keyboard, etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When these events are triggered, you can then use a custom function to do pretty much whatever you want with the event. These custom functions call Event Handlers.&lt;/p&gt;
&lt;h2&gt;Binding Event Handlers&lt;/h2&gt;
&lt;p&gt;Using the jQuery Event Model, we can establish event handlers on DOM elements with the&amp;nbsp;&lt;strong&gt;bind()&lt;/strong&gt;&amp;nbsp;method as follows &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/mviPhF&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The jQuery Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;language&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;div&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;bind&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;click&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; event &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Hi there!&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; margin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;12px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;2px&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; solid &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;#666; width:60px;}&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click on any square below to see the result:&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;div&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;blue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ONE&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;div&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;green&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;TWO&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;div&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;red&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;THREE&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This code will cause the division element to respond to the click event; when a user clicks inside this division thereafter, the alert will be shown.&lt;/p&gt;
&lt;p&gt;This will produce following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/jquery/src/binding-event-handlers.htm&quot; width=&quot;300&quot; height=&quot;150&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;The full syntax of the bind() command is as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&lt;em&gt;selector&lt;/em&gt;.bind( eventType[, eventData], handler)
&lt;/pre&gt;
&lt;p&gt;Following is the description of the parameters &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;eventType&lt;/strong&gt;&amp;nbsp;&amp;minus; A string containing a JavaScript event type, such as click or submit. Refer to the next section for a complete list of event types.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;eventData&lt;/strong&gt;&amp;nbsp;&amp;minus; This is optional parameter is a map of data that will be passed to the event handler.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;handler&lt;/strong&gt;&amp;nbsp;&amp;minus; A function to execute each time the event is triggered.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Removing Event Handlers&lt;/h2&gt;
&lt;p&gt;Typically, once an event handler is established, it remains in effect for the remainder of the life of the page. There may be a need when you would like to remove event handler.&lt;/p&gt;
&lt;p&gt;jQuery provides the&amp;nbsp;&lt;strong&gt;unbind()&lt;/strong&gt;&amp;nbsp;command to remove an exiting event handler. The syntax of unbind() is as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&lt;em&gt;selector&lt;/em&gt;.unbind(eventType, handler)

or 

&lt;em&gt;selector&lt;/em&gt;.unbind(eventType)
&lt;/pre&gt;
&lt;p&gt;Following is the description of the parameters &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;eventType&lt;/strong&gt;&amp;nbsp;&amp;minus; A string containing a JavaScript event type, such as click or submit. Refer to the next section for a complete list of event types.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;handler&lt;/strong&gt;&amp;nbsp;&amp;minus; If provided, identifies the specific listener that&#39;s to be removed.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Event Types&lt;/h2&gt;
&lt;section class=&quot;toggle&quot;&gt;&lt;label&gt;The following are cross platform and recommended event types which you can bind using JQuery &amp;minus;&lt;/label&gt;&lt;/section&gt;
&lt;h2&gt;The Event Object&lt;/h2&gt;
&lt;p&gt;The callback function takes a single parameter; when the handler is called the JavaScript event object will be passed through it.&lt;/p&gt;
&lt;p&gt;The event object is often unnecessary and the parameter is omitted, as sufficient context is usually available when the handler is bound to know exactly what needs to be done when the handler is triggered, however there are certain attributes which you would need to be accessed.&lt;/p&gt;
&lt;h2&gt;The Event Attributes&lt;/h2&gt;
&lt;section class=&quot;toggle&quot;&gt;&lt;label&gt;The following event properties/attributes are available and safe to access in a platform independent manner &amp;minus;&lt;/label&gt;&lt;/section&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/LthNJW&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The jQuery Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;language&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;div&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;bind&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;click&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; event &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Event type is &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; event&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;pageX : &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; event&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;pageX&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;pageY : &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; event&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;pageY&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Target : &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; event&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;target&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;innerHTML&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; margin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;12px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;2px&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; solid &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;#666; width:60px;}&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click on any square below to see the result:&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;div&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;blue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ONE&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;div&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;green&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;TWO&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;div&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;red&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;THREE&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/jquery/src/event-attributes.htm&quot; width=&quot;300&quot; height=&quot;150&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;The Event Methods&lt;/h2&gt;
&lt;p&gt;There is a list of methods which can be called on an Event Object &amp;minus;&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th width=&quot;10%&quot;&gt;Sr.No.&lt;/th&gt;
&lt;th&gt;Method &amp;amp; Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;1&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/events-preventdefault.htm&quot;&gt;preventDefault()&lt;/a&gt;
&lt;p&gt;Prevents the browser from executing the default action.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;2&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/events-isdefaultprevented.htm&quot;&gt;isDefaultPrevented()&lt;/a&gt;
&lt;p&gt;Returns whether event.preventDefault() was ever called on this event object.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;3&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/events-stoppropagation.htm&quot;&gt;stopPropagation()&lt;/a&gt;
&lt;p&gt;Stops the bubbling of an event to parent elements, preventing any parent handlers from being notified of the event.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;4&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/events-ispropagationstopped.htm&quot;&gt;isPropagationStopped()&lt;/a&gt;
&lt;p&gt;Returns whether event.stopPropagation() was ever called on this event object.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;5&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/events-stopimmediatepropagation.htm&quot;&gt;stopImmediatePropagation()&lt;/a&gt;
&lt;p&gt;Stops the rest of the handlers from being executed.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;6&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/events-isimmediatepropagationstopped.htm&quot;&gt;isImmediatePropagationStopped()&lt;/a&gt;
&lt;p&gt;Returns whether event.stopImmediatePropagation() was ever called on this event object.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Event Manipulation Methods&lt;/h2&gt;
&lt;p&gt;Following table lists down important event-related methods &amp;minus;&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th width=&quot;10%&quot;&gt;Sr.No.&lt;/th&gt;
&lt;th&gt;Method &amp;amp; Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;1&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/events-bind.htm&quot;&gt;bind( type, [data], fn )&lt;/a&gt;
&lt;p&gt;Binds a handler to one or more events (like click) for each matched element. Can also bind custom events.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;2&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/events-off.htm&quot;&gt;off( events [, selector ] [, handler(eventObject) ] )&lt;/a&gt;
&lt;p&gt;This does the opposite of live, it removes a bound live event.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;3&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/events-hover.htm&quot;&gt;hover( over, out )&lt;/a&gt;
&lt;p&gt;Simulates hovering for example moving the mouse on, and off, an object.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;4&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/events-on.htm&quot;&gt;on( events [, selector ] [, data ], handler )&lt;/a&gt;
&lt;p&gt;Binds a handler to an event (like click) for all current &amp;minus; and future &amp;minus; matched element. Can also bind custom events.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;5&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/events-one.htm&quot;&gt;one( type, [data], fn )&lt;/a&gt;
&lt;p&gt;Binds a handler to one or more events to be executed once for each matched element.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;6&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/events-ready.htm&quot;&gt;ready( fn )&lt;/a&gt;
&lt;p&gt;Binds a function to be executed whenever the DOM is ready to be traversed and manipulated.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;7&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/events-trigger.htm&quot;&gt;trigger( event, [data] )&lt;/a&gt;
&lt;p&gt;Trigger an event on every matched element.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;8&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/events-triggerhandler.htm&quot;&gt;triggerHandler( event, [data] )&lt;/a&gt;
&lt;p&gt;Triggers all bound event handlers on an element.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;9&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/events-unbind.htm&quot;&gt;unbind( [type], [fn] )&lt;/a&gt;
&lt;p&gt;This does the opposite of bind, it removes bound events from each of the matched elements.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Event Helper Methods&lt;/h2&gt;
&lt;p&gt;jQuery also provides a set of event helper functions which can be used either to trigger an event to bind any event types mentioned above.&lt;/p&gt;
&lt;h2&gt;Trigger Methods&lt;/h2&gt;
&lt;p&gt;Following is an example which would triggers the blur event on all paragraphs &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;$(&quot;p&quot;).blur();
&lt;/pre&gt;
&lt;h2&gt;Binding Methods&lt;/h2&gt;
&lt;p&gt;Following is an example which would bind a&amp;nbsp;&lt;strong&gt;click&lt;/strong&gt;&amp;nbsp;event on all the &amp;lt;div&amp;gt; &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;$(&quot;div&quot;).click( function () { 
   // do something here
});
&lt;/pre&gt;
&lt;section class=&quot;toggle&quot;&gt;&lt;label&gt;Here is a complete list of all the support methods provided by jQuery &amp;minus;&lt;/label&gt;&lt;/section&gt;

&lt;h1&gt;Ajax&lt;/h1&gt;
&lt;p&gt;AJAX is an acronym standing for Asynchronous JavaScript and XML and this technology helps us to load data from the server without a browser page refresh.&lt;/p&gt;
&lt;p&gt;If you are new with AJAX, I would recommend you go through our&amp;nbsp;&lt;a href=&quot;https://www.tutorialspoint.com/ajax/index.htm&quot;&gt;Ajax Tutorial&lt;/a&gt;&amp;nbsp;before proceeding further.&lt;/p&gt;
&lt;p&gt;JQuery is a great tool which provides a rich set of AJAX methods to develop next generation web application.&lt;/p&gt;
&lt;h2&gt;Loading Simple Data&lt;/h2&gt;
&lt;p&gt;This is very easy to load any static or dynamic data using JQuery AJAX. JQuery provides&amp;nbsp;&lt;strong&gt;load()&lt;/strong&gt;&amp;nbsp;method to do the job &amp;minus;&lt;/p&gt;
&lt;h3&gt;Syntax&lt;/h3&gt;
&lt;p&gt;Here is the simple syntax for&amp;nbsp;&lt;strong&gt;load()&lt;/strong&gt;&amp;nbsp;method &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&lt;strong&gt;[selector].&lt;/strong&gt;load( URL, [data], [callback] );
&lt;/pre&gt;
&lt;p&gt;Here is the description of all the parameters &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;URL&lt;/strong&gt;&amp;nbsp;&amp;minus; The URL of the server-side resource to which the request is sent. It could be a CGI, ASP, JSP, or PHP script which generates data dynamically or out of a database.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;data&lt;/strong&gt;&amp;nbsp;&amp;minus; This optional parameter represents an object whose properties are serialized into properly encoded parameters to be passed to the request. If specified, the request is made using the&amp;nbsp;&lt;strong&gt;POST&lt;/strong&gt;&amp;nbsp;method. If omitted, the&amp;nbsp;&lt;strong&gt;GET&lt;/strong&gt;method is used.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;callback&lt;/strong&gt;&amp;nbsp;&amp;minus; A callback function invoked after the response data has been loaded into the elements of the matched set. The first parameter passed to this function is the response text received from the server and second parameter is the status code.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Consider the following HTML file with a small JQuery coding &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/n4DZhm&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The jQuery Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;language&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;#driver&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;#stage&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;load&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;/jquery/result.html&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click on the button to load /jquery/result.html file &amp;minus;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;stage&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;cc0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         STAGE
      &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;button&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;driver&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Load Data&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Here&amp;nbsp;&lt;strong&gt;load()&lt;/strong&gt;&amp;nbsp;initiates an Ajax request to the specified URL&amp;nbsp;&lt;strong&gt;/jquery/result.html&lt;/strong&gt;&amp;nbsp;file. After loading this file, all the content would be populated inside &amp;lt;div&amp;gt; tagged with ID&amp;nbsp;&lt;em&gt;stage&lt;/em&gt;. Assuming, our /jquery/result.html file has just one HTML line &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&amp;lt;h1&amp;gt;THIS IS RESULT...&amp;lt;/h1&amp;gt;
&lt;/pre&gt;
&lt;p&gt;When you click the given button, then result.html file gets loaded.&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/jquery/src/loading-simple-data.htm&quot; width=&quot;100%&quot; height=&quot;150&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Getting JSON Data&lt;/h2&gt;
&lt;p&gt;There would be a situation when server would return JSON string against your request. JQuery utility function&amp;nbsp;&lt;strong&gt;getJSON()&lt;/strong&gt;&amp;nbsp;parses the returned JSON string and makes the resulting string available to the callback function as first parameter to take further action.&lt;/p&gt;
&lt;h3&gt;Syntax&lt;/h3&gt;
&lt;p&gt;Here is the simple syntax for&amp;nbsp;&lt;strong&gt;getJSON()&lt;/strong&gt;&amp;nbsp;method &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&lt;strong&gt;[selector].&lt;/strong&gt;getJSON( URL, [data], [callback] );
&lt;/pre&gt;
&lt;p&gt;Here is the description of all the parameters &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;URL&lt;/strong&gt;&amp;nbsp;&amp;minus; The URL of the server-side resource contacted via the GET method.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;data&lt;/strong&gt;&amp;nbsp;&amp;minus; An object whose properties serve as the name/value pairs used to construct a query string to be appended to the URL, or a preformatted and encoded query string.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;callback&lt;/strong&gt;&amp;nbsp;&amp;minus; A function invoked when the request completes. The data value resulting from digesting the response body as a JSON string is passed as the first parameter to this callback, and the status as the second.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Consider the following HTML file with a small JQuery coding &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/dGRqqF&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The jQuery Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;language&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;#driver&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
				
               $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;getJSON&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;/jquery/result.json&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;jd&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;#stage&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;p&amp;gt; Name: &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; jd&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;/p&amp;gt;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;#stage&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;p&amp;gt;Age : &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; jd&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;age&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;/p&amp;gt;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;#stage&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;p&amp;gt; Sex: &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; jd&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;sex&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;/p&amp;gt;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
					
            &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click on the button to load result.json file &amp;minus;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;stage&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:#&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;eee&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         STAGE
      &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;button&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;driver&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Load Data&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Here JQuery utility method&amp;nbsp;&lt;strong&gt;getJSON()&lt;/strong&gt;&amp;nbsp;initiates an Ajax request to the specified URL&amp;nbsp;&lt;strong&gt;result.json&lt;/strong&gt;&amp;nbsp;file. After loading this file, all the content would be passed to the callback function which finally would be populated inside &amp;lt;div&amp;gt; tagged with ID&amp;nbsp;&lt;em&gt;stage&lt;/em&gt;. Assuming, our result.json file has following json formatted content &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;{
   &quot;name&quot;: &quot;Zara Ali&quot;,
   &quot;age&quot; : &quot;67&quot;,
   &quot;sex&quot;: &quot;female&quot;
}
&lt;/pre&gt;
&lt;p&gt;When you click the given button, then result.json file gets loaded.&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/jquery/src/getting-json-data.htm&quot; width=&quot;100%&quot; height=&quot;150&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Passing Data to the Server&lt;/h2&gt;
&lt;p&gt;Many times you collect input from the user and you pass that input to the server for further processing. JQuery AJAX made it easy enough to pass collected data to the server using&amp;nbsp;&lt;strong&gt;data&lt;/strong&gt;&amp;nbsp;parameter of any available Ajax method.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;This example demonstrate how can pass user input to a web server script which would send the same result back and we would print it &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/aU6ni2&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The jQuery Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;language&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;#driver&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;){&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;#name&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;#stage&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;load&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;/jquery/result.php&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Enter your name and click on the button:&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;input&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;name&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;size&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;40&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&amp;lt;br&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;stage&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;cc0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         STAGE
      &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;button&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;driver&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Show Result&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Here is the code written in&amp;nbsp;&lt;strong&gt;result.php&lt;/strong&gt;&amp;nbsp;script &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;php
   &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $_REQUEST&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      $name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $_REQUEST&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;name&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;];&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      echo &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Welcome &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;?&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;p&gt;Now you can enter any text in the given input box and then click &quot;Show Result&quot; button to see what you have entered in the input box.&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/jquery/src/passing-data-to-server.htm&quot; width=&quot;100%&quot; height=&quot;150&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;JQuery AJAX Methods&lt;/h2&gt;
&lt;p&gt;You have seen basic concept of AJAX using JQuery. Following table lists down all important JQuery AJAX methods which you can use based your programming need &amp;minus;&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th width=&quot;10%&quot;&gt;Sr.No.&lt;/th&gt;
&lt;th&gt;Methods &amp;amp; Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;1&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/ajax-jquery-ajax.htm&quot;&gt;jQuery.ajax( options )&lt;/a&gt;
&lt;p&gt;Load a remote page using an HTTP request.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;2&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/ajax-jquery-ajaxsetup.htm&quot;&gt;jQuery.ajaxSetup( options )&lt;/a&gt;
&lt;p&gt;Setup global settings for AJAX requests.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;3&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/ajax-jquery-get.htm&quot;&gt;jQuery.get( url, [data], [callback], [type] )&lt;/a&gt;
&lt;p&gt;Load a remote page using an HTTP GET request.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;4&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/ajax-jquery-getjson.htm&quot;&gt;jQuery.getJSON( url, [data], [callback] )&lt;/a&gt;
&lt;p&gt;Load JSON data using an HTTP GET request.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;5&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/ajax-jquery-getscript.htm&quot;&gt;jQuery.getScript( url, [callback] )&lt;/a&gt;
&lt;p&gt;Loads and executes a JavaScript file using an HTTP GET request.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;6&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/ajax-jquery-post.htm&quot;&gt;jQuery.post( url, [data], [callback], [type] )&lt;/a&gt;
&lt;p&gt;Load a remote page using an HTTP POST request.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;7&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/ajax-load.htm&quot;&gt;load( url, [data], [callback] )&lt;/a&gt;
&lt;p&gt;Load HTML from a remote file and inject it into the DOM.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;8&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/ajax-serialize.htm&quot;&gt;serialize( )&lt;/a&gt;
&lt;p&gt;Serializes a set of input elements into a string of data.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;9&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/ajax-serializearray.htm&quot;&gt;serializeArray( )&lt;/a&gt;
&lt;p&gt;Serializes all forms and form elements like the .serialize() method but returns a JSON data structure for you to work with.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;JQuery AJAX Events&lt;/h2&gt;
&lt;p&gt;You can call various JQuery methods during the life cycle of AJAX call progress. Based on different events/stages following methods are available &amp;minus;&lt;/p&gt;
&lt;p&gt;You can go through all the&amp;nbsp;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/ajax-events.htm&quot;&gt;AJAX Events&lt;/a&gt;.&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th width=&quot;10%&quot;&gt;Sr.No.&lt;/th&gt;
&lt;th&gt;Methods &amp;amp; Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;1&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/ajaxcomplete.htm&quot;&gt;ajaxComplete( callback )&lt;/a&gt;
&lt;p&gt;Attach a function to be executed whenever an AJAX request completes.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;2&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/ajaxstart.htm&quot;&gt;ajaxStart( callback )&lt;/a&gt;
&lt;p&gt;Attach a function to be executed whenever an AJAX request begins and there is none already active.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;3&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/ajaxerror.htm&quot;&gt;ajaxError( callback )&lt;/a&gt;
&lt;p&gt;Attach a function to be executed whenever an AJAX request fails.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;4&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/ajaxsend.htm&quot;&gt;ajaxSend( callback )&lt;/a&gt;
&lt;p&gt;Attach a function to be executed before an AJAX request is sent.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;5&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/ajaxstop.htm&quot;&gt;ajaxStop( callback )&lt;/a&gt;
&lt;p&gt;Attach a function to be executed whenever all AJAX requests have ended.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;6&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/ajaxsuccess.htm&quot;&gt;ajaxSuccess( callback )&lt;/a&gt;
&lt;p&gt;Attach a function to be executed whenever an AJAX request completes successfully.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;h1&gt;Interaction&lt;/h1&gt;
&lt;p&gt;Interactions could be added basic mouse-based behaviours to any element. Using with interactions, We can create sortable lists, resizeable elements, drag &amp;amp; drop behaviours.Interactions also make great building blocks for more complex widgets and applications.&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th width=&quot;10%&quot;&gt;Sr.No.&lt;/th&gt;
&lt;th&gt;Interactions &amp;amp; Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;1&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/interactions-dragable.htm&quot;&gt;Drag able&lt;/a&gt;
&lt;p&gt;Enable drag able functionality on any DOM element.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;2&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/interactions-dropable.htm&quot;&gt;Drop able&lt;/a&gt;
&lt;p&gt;Enable any DOM element to be drop able.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;3&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/interactions-resizeable.htm&quot;&gt;Resize able&lt;/a&gt;
&lt;p&gt;Enable any DOM element to be resize-able.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;4&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/interactions-selectable.htm&quot;&gt;Select able&lt;/a&gt;
&lt;p&gt;Enable a DOM element (or group of elements) to be selectable.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;5&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/interactions-sortable.htm&quot;&gt;Sort able&lt;/a&gt;
&lt;p&gt;Enable a group of DOM elements to be sortable.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;h1&gt;Widgets&lt;/h1&gt;
&lt;p&gt;a jQuery UI widget is a specialized jQuery plug-in.Using plug-in, we can apply behaviours to the elements. However, plug-ins lack some built-in capabilities, such as a way to associate data with its elements, expose methods, merge options with defaults, and control the plug-in&#39;s lifetime.&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th width=&quot;10%&quot;&gt;Sr.No.&lt;/th&gt;
&lt;th&gt;Widgets &amp;amp; Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;1&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/widget-accordion.htm&quot;&gt;Accordion&lt;/a&gt;
&lt;p&gt;Enable to collapse the content, that is broken into logical sections.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;2&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/widget-autocomplete.htm&quot;&gt;Autocomplete&lt;/a&gt;
&lt;p&gt;Enable to provides the suggestions while you type into the field.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;3&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/widget-button.htm&quot;&gt;Button&lt;/a&gt;
&lt;p&gt;Button is an input of type submit and an anchor.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;4&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/widget-datepicker.htm&quot;&gt;Datepicker&lt;/a&gt;
&lt;p&gt;It is to open an interactive calendar in a small overlay.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;5&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/widget-dialog.htm&quot;&gt;Dialog&lt;/a&gt;
&lt;p&gt;Dialog boxes are one of the nice ways of presenting information on an HTML page.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;6&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/widget-menu.htm&quot;&gt;Menu&lt;/a&gt;
&lt;p&gt;Menu shows list of items.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;7&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/widget-progressbar.htm&quot;&gt;Progressbar&lt;/a&gt;
&lt;p&gt;It shows the progress information.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;8&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/widget-selectmenu.htm&quot;&gt;Select menu&lt;/a&gt;
&lt;p&gt;Enable a style able select element/elements.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;9&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/widget-slider.htm&quot;&gt;Slider&lt;/a&gt;
&lt;p&gt;The basic slider is horizontal and has a single handle that can be moved with the mouse or by using the arrow keys.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;10&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/widget-spinner.htm&quot;&gt;Spinner&lt;/a&gt;
&lt;p&gt;It provides a quick way to select one value from a set.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;11&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/widget-tab.htm&quot;&gt;Tabs&lt;/a&gt;
&lt;p&gt;It is used to swap between content that is broken into logical sections.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;12&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/widget-tooltip.htm&quot;&gt;Tooltip&lt;/a&gt;
&lt;p&gt;Its provides the tips for the users.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;h1&gt;Theming&lt;/h1&gt;
&lt;p&gt;Jquery has two different styling themes as A And B.Each with different colors for buttons, bars, content blocks, and so on.&lt;/p&gt;
&lt;p&gt;The syntax of J query theming as shown below &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&amp;lt;div data-role = &quot;page&quot; data-theme = &quot;a|b&quot;&amp;gt;
&lt;/pre&gt;
&lt;p&gt;A Simple of A theming Example as shown below &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/BMCBbx&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;viewport&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;content&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;width = device-width, initial-scale = 1&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;rel&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;stylesheet&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
			
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://code.jquery.com/jquery-1.11.3.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://code.jquery.com/jquery-1.11.3.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;data-role&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;page&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;pageone&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;data-theme&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;a&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;data-role&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;header&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Tutorials Point&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;data-role&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;main&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;ui-content&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
			
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Text link&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;#&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;A Standard Text Link&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;ui-btn&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Link Button&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;A List View:&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
				
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;ul&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;data-role&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;listview&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;data-autodividers&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;true&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;data-inset&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;#&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Android &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;#&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;IOS&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
				
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;label&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;fullname&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Input Field:&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;fullname&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;fullname&quot;&lt;/span&gt; 
               &lt;span class=&quot;atn&quot;&gt;placeholder&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Name..&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;    
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;label&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;switch&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Toggle Switch:&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;
				
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;select&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;switch&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;switch&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;data-role&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;slider&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;option&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;on&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;On&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/option&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;option&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;off&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;selected&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Off&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/option&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/select&amp;gt;&lt;/span&gt;
				
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;data-role&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;footer&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Tutorials point&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This should produce following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/jquery/src/atheme.htm&quot; width=&quot;100%&quot; height=&quot;150&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;A Simple of B theming Example as shown below &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/gYDZDP&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;viewport&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;content&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;width = device-width, initial-scale = 1&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;rel&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;stylesheet&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://code.jquery.com/jquery-1.11.3.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://code.jquery.com/jquery-1.11.3.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;data-role&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;page&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;pageone&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;data-theme&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;b&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;data-role&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;header&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Tutorials Point&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;data-role&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;main&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;ui-content&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Text link&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;#&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;A Standard Text Link&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;ui-btn&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Link Button&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;A List View:&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
				
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;ul&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;data-role&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;listview&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;data-autodividers&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;true&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;data-inset&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;#&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Android &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;#&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;IOS&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
				
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;label&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;fullname&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Input Field:&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;fullname&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;fullname&quot;&lt;/span&gt; 
               &lt;span class=&quot;atn&quot;&gt;placeholder&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Name..&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;    
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;label&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;switch&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Toggle Switch:&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;
				
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;select&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;switch&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;switch&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;data-role&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;slider&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;option&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;on&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;On&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/option&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;option&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;off&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;selected&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Off&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/option&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/select&amp;gt;&lt;/span&gt;
				
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;data-role&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;footer&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Tutorials point&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This should produce following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/jquery/src/btheme.htm&quot; width=&quot;100%&quot; height=&quot;150&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;

&lt;h1&gt;Utilities&lt;/h1&gt;
&lt;p&gt;Jquery provides serveral utilities in the formate of $(name space). These methods are helpful to complete the programming tasks.a few of the utility methods are as show below.&lt;/p&gt;
&lt;h2&gt;$.trim()&lt;/h2&gt;
&lt;p&gt;$.trim() is used to Removes leading and trailing whitespace&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;$.trim( &quot;    lots of extra whitespace    &quot; );
&lt;/pre&gt;
&lt;h2&gt;$.each()&lt;/h2&gt;
&lt;p&gt;$.each() is used to Iterates over arrays and objects&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;each&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;([&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;foo&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;bar&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;baz&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; idx&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; val &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;element &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; idx &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot; is &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; val &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
 
$&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;each&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; foo&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;bar&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; baz&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;bim&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; k&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; v &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; k &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot; : &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; v &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;.each() can be called on a selection to iterate over the elements contained in the selection. .each(), not $.each(), should be used for iterating over elements in a selection.&lt;/p&gt;
&lt;h2&gt;$.inArray()&lt;/h2&gt;
&lt;p&gt;$.inArray() is used to Returns a value&#39;s index in an array, or -1 if the value is not in the array.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myArray &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;5&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;];&lt;/span&gt;
 
&lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;inArray&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myArray &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;!==&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;found it!&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;$.extend()&lt;/h2&gt;
&lt;p&gt;$.extend() is used to Changes the properties of the first object using the properties of subsequent objects.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;var firstObject = { foo: &quot;bar&quot;, a: &quot;b&quot; };
var secondObject = { foo: &quot;baz&quot; };
 
var newObject = $.extend( firstObject, secondObject );
 
console.log( firstObject.foo ); 
console.log( newObject.foo );
&lt;/pre&gt;
&lt;h2&gt;$.proxy()&lt;/h2&gt;
&lt;p&gt;$.proxy() is used to Returns a function that will always run in the provided scope &amp;mdash; that is, sets the meaning of this inside the passed function to the second argument&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myFunction &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;};&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myObject &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   foo&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;bar&quot;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;};&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
 
myFunction&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;// window&lt;/span&gt;
 
&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myProxyFunction &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;proxy&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myFunction&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myObject &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
 
myProxyFunction&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;$.browser&lt;/h2&gt;
&lt;p&gt;$.browser is used to give the information about browsers&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;jQuery&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;each&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; jQuery&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;browser&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; i&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; val &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;div&amp;gt;&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; i &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot; : &amp;lt;span&amp;gt;&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; val &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;/span&amp;gt;&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;appendTo&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;body &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;$.contains()&lt;/h2&gt;
&lt;p&gt;$.contains() is used to returns true if the DOM element provided by the second argument is a descendant of the DOM element provided by the first argument, whether it is a direct child or nested more deeply.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;$.contains( document.documentElement, document.body );
$.contains( document.body, document.documentElement );
&lt;/pre&gt;
&lt;h2&gt;$.data()&lt;/h2&gt;
&lt;p&gt;$.data() is used to give the information about data&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/CDQqsU&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;lang&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;en&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;jQuery.data demo&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://code.jquery.com/jquery-1.10.2.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         The values stored were &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;span&amp;gt;&amp;lt;/span&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            and &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;span&amp;gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
 
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; div &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;div&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;)[&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;];&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
			
         jQuery&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; div&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;test&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            first&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;25&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            last&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;tutorials&quot;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
			
         $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;span:first&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; jQuery&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; div&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;test&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;first &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;span:last&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; jQuery&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; div&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;test&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;last &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;An output would be as follows&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;The values stored were 25 and tutorials
&lt;/pre&gt;
&lt;h2&gt;$.fn.extend()&lt;/h2&gt;
&lt;p&gt;$.fn.extend() is used to extends the jQuery prototype&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/dmTyXJ&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;lang&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;en&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://code.jquery.com/jquery-1.10.2.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;label&amp;gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;checkbox&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;android&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
         Android&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;label&amp;gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;checkbox&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;ios&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; IOS&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;
 
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         jQuery&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;fn&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;extend&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
			
            check&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;each&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;checked &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            uncheck&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;each&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;checked &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
 
         &lt;span class=&quot;com&quot;&gt;// Use the newly created .check() method&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;input[type = &#39;checkbox&#39;]&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;check&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;
			
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;It provides the output as shown below &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/jquery/src/fn.utilities.htm&quot; width=&quot;300&quot; height=&quot;150&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;$.isWindow()&lt;/h2&gt;
&lt;p&gt;$.isWindow() is used to recognise the window&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/SkvZVN&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!doctype html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;lang&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;en&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;charset&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;jQuery.isWindow demo&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://code.jquery.com/jquery-1.10.2.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      Is &#39;window&#39; a window? &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;b&amp;gt;&amp;lt;/b&amp;gt;&lt;/span&gt;
 
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;b&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;isWindow&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; window &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;It provides the output as shown below &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/jquery/src/iswindow.htm&quot; width=&quot;300&quot; height=&quot;150&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;$.now()&lt;/h2&gt;
&lt;p&gt;It returns a number which is representing the current time&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;(new Date).getTime()
&lt;/pre&gt;
&lt;h2&gt;$.isXMLDoc()&lt;/h2&gt;
&lt;p&gt;$.isXMLDoc() checks whether a file is an xml or not&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;jQuery.isXMLDoc( document )
jQuery.isXMLDoc( document.body )
&lt;/pre&gt;
&lt;h2&gt;$.globalEval()&lt;/h2&gt;
&lt;p&gt;$.globalEval() is used to execute the javascript globally&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; test&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   jQuery&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;globalEval&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;var newVar = true;&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
test&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;$.dequeue()&lt;/h2&gt;
&lt;p&gt;$.dequeue() is used to execute the next function in the queue&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/BnDYll&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!doctype html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;lang&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;en&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;charset&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;jQuery.dequeue demo&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         div &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            margin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;3px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;50px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            position&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; absolute&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            height&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;50px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            left&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            top&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;30px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; green&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            border&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;radius&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;50px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         div&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;red &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; blue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://code.jquery.com/jquery-1.10.2.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;button&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Start&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
 
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;button&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;div&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;animate&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; left&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;+ = 400px&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;2000&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;animate&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; top&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;0px&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;600&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
				
            &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;queue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;toggleClass&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;red&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;dequeue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;
				
            &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;animate&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; left&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;10px&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; top&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;30px&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;700&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;It provides the output as shown below &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/jquery/src/dequeue.htm&quot; width=&quot;300&quot; height=&quot;150&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;

&lt;h1&gt;Flickerplate&lt;/h1&gt;
&lt;p&gt;Flickerplate is a jQuery plugin for creating a slider which allows you cycle through images with animated arrows and dots navigation.&lt;/p&gt;
&lt;p&gt;A Simple of flickerplate example as shown below &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;   
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;charset&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;viewport&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;content&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;width = device-width, 
         initial-scale = 1.0, maximum-scale = 1.0, user-scalable = no&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;    
	
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/jquery/src/flickerplate/js/min/jquery-v1.10.2.min.js&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
			
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/jquery/src/flickerplate/js/min/modernizr-custom-v2.7.1.min.js&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
			
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/jquery/src/flickerplate/js/min/hammer-v2.0.3.min.js&quot;&lt;/span&gt;
         &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

      &lt;span class=&quot;tag&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/jquery/src/flickerplate/css/flickerplate.css&quot;&lt;/span&gt;  
         &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/css&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;rel&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;stylesheet&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
			
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/jquery/src/flickerplate/js/min/flickerplate.min.js&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;	
	
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(){&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;.flicker-example&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;flickerplate&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               auto_flick        &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               auto_flick_delay  &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               flick_animation   &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;transform-slide&#39;&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

      &lt;span class=&quot;tag&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/jquery/src/flickerplate/css/demo.css&quot;&lt;/span&gt;  
         &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/css&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;rel&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;stylesheet&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;flicker-example&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;data-background&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://genblock.com/wp-content/uploads/2015
               /05/download-circles-abstract-wallpaper-
               abstract-photo-abstract-wallpaper.jpg&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
					
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://www.tutorialspoint.com/about/images/mohtashim.jpg&quot;&lt;/span&gt; 
                  &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;428px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
						
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;flick-title&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Mohtashim M.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
					
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;flick-sub-text&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  Mohtashim is an MCA from AMU (Aligarah) and a Project
                  Management Professional. He has more than 17 years of 
                  experience in Telecom and Datacom industries covering 
                  complete SDLC. He is managing in-house innovations, 
                  business planning, implementation, finance and the overall
                  business development of Tutorials Point.
               &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
					
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;data-background&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://genblock.com/wp-content/uploads/2015
               /05/download-circles-abstract-wallpaper-
               abstract-photo-abstract-wallpaper.jpg&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
					
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://www.tutorialspoint.com/about/images/gopal_verma.jpg&quot;&lt;/span&gt; 
                  &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;428px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
						
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;flick-title&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Gopal K Verma&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
					
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;flick-sub-text&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  Gopal is an MCA from GJU (Hisar) and a Cisco Certified Network 
                  Professional. He has more than 11 years of experience in core 
                  data networking and telecommunications. He develops contents 
                  for Computer Science related subjects. He is also involved in 
                  developing Apps for various Mobile devices.
               &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;data-background&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://genblock.com/wp-content/uploads/2015
               /05/download-circles-abstract-wallpaper-
               abstract-photo-abstract-wallpaper.jpg&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
					
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://www.tutorialspoint.com/about/images/mukesh_kumar.jpg&quot;&lt;/span&gt; 
                  &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;428px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
						
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;flick-title&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Mukesh Kumar&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
					
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;flick-sub-text&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  Mukesh Kumar, having 7+years experience in writing on various
                  topics ranging from IT products and services, legal, medical,
                  online advertisement &amp;amp; education to e-commerce businesses.
                  He also has experience of text &amp;amp; copy-editing, &amp;amp; online
                  research. He has done two masters &amp;ndash; MA (Geography) from
                  University of Delhi and MA (Mass Communication &amp;amp; 
                  Journalism) from Kurukshetra University.
               &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This should produce following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/src/flickerplate/index.htm&quot;&gt;Click here&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;Slide Show&lt;/h1&gt;
&lt;p&gt;Slideshow.js is a jQuery plugin for quickly and easily implementing slide show of images or videos into your website.&lt;/p&gt;
&lt;p&gt;A Simple of slide show example as shown below &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; 
   &quot;https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&amp;gt;&lt;/span&gt;

&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;xmlns&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://www.w3.org/1999/xhtml&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;xml:lang&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;en&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;lang&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;en&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;http-equiv&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;content-type&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;content&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/html; charset = UTF-8&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;rel&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;stylesheet&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;css/supersized.css&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/css&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;media&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;screen&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;rel&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;stylesheet&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;theme/supersized.shutter.css&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/css&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;media&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;screen&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot; js/jquery.easing.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot; js/supersized.3.2.7.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;theme/supersized.shutter.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         jQuery&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;supersized&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               slideshow         &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;			
               autoplay          &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;			
               start_slide       &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;			
               stop_loop         &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;			
               random            &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;			
               slide_interval    &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;lit&quot;&gt;3000&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;		
               transition        &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;lit&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 			
               transition_speed  &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;lit&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;		
               new_window        &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;			
               pause_hover       &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;			
               keyboard_nav      &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;			
               performance       &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;			
               image_protect     &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;			
                                                
               min_width         &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;			
               min_height        &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;			
               vertical_center   &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;			
               horizontal_center &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;			
               fit_always        &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;			
               fit_portrait      &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;			
               fit_landscape     &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;			
               
               slide_links       &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;str&quot;&gt;&#39;blank&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;	
               thumb_links       &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;			
               thumbnail_navigation    &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;   &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;			
               slides            &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;  	
               &lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;			
                  &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                     image &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;https://buildinternet.s3.amazonaws.com/projects/supersized/3.2/slides/kazvan-1.jpg&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
                        title &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Sample demo&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
                        thumb &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;https://buildinternet.s3.amazonaws.com/projects/supersized/3.2/thumbs/kazvan-1.jpg&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
                        url &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;https://www.tutorialspoint.com&#39;&lt;/span&gt;
                  &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
                  &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                     image &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;https://buildinternet.s3.amazonaws.com/projects/supersized/3.2/slides/kazvan-3.jpg&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
                        title &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Sample demo&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
                        thumb &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;https://buildinternet.s3.amazonaws.com/projects/supersized/3.2/thumbs/kazvan-3.jpg&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
                        url &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;https://www.tutorialspoint.com&#39;&lt;/span&gt;
                  &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
                  &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                     image &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;https://buildinternet.s3.amazonaws.com/projects/supersized/3.2/slides/wojno-1.jpg&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
                        title &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Sample demo&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
                        thumb &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;https://buildinternet.s3.amazonaws.com/projects/supersized/3.2/thumbs/wojno-1.jpg&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
                        url &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;https://www.tutorialspoint.com&#39;&lt;/span&gt;
                  &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
                  &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                     image &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;https://buildinternet.s3.amazonaws.com/projects/supersized/3.2/slides/wojno-2.jpg&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
                        title &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Sample demo&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
                        thumb &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;https://buildinternet.s3.amazonaws.com/projects/supersized/3.2/thumbs/wojno-2.jpg&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
                        url &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;https://www.tutorialspoint.com&#39;&lt;/span&gt;
                  &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
                  &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                     image &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;https://buildinternet.s3.amazonaws.com/projects/supersized/3.2/slides/wojno-3.jpg&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
                        title &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Sample demo&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
                        thumb &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;https://buildinternet.s3.amazonaws.com/projects/supersized/3.2/thumbs/wojno-3.jpg&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
                        url &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;https://www.tutorialspoint.com&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               progress_bar      &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;	&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;			
               mouse_scrub       &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;	&lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;style&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/css&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      ul&lt;/span&gt;&lt;span class=&quot;com&quot;&gt;#demo-block{ margin:0 15px 15px 15px; }&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      ul&lt;/span&gt;&lt;span class=&quot;com&quot;&gt;#demo-block li{ margin:0 0 10px 0; padding:10px; display:inline; &lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; clear&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;both&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:#&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;aaa&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;img/bg-black.png&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
         font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;11px&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Helvetica&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Arial&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; sans&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;serif&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      ul&lt;/span&gt;&lt;span class=&quot;com&quot;&gt;#demo-block li a{ color:#eee; font-weight:bold; }&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;prevthumb&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;nextthumb&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;prevslide&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;load-item&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;nextslide&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;load-item&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;thumb-tray&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;load-item&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;thumb-back&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;thumb-forward&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;progress-back&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;load-item&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;progress-bar&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;controls-wrapper&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;load-item&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;controls&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;play-button&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;pauseplay&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;img/pause.png&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&amp;lt;/a&amp;gt;&lt;/span&gt;

            &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;slidecounter&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;slidenumber&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/span&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; / &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;totalslides&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

            &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;slidecaption&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

            &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;tray-button&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;tray-arrow&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;img/button-tray-up.png&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&amp;lt;/a&amp;gt;&lt;/span&gt;

            &lt;span class=&quot;tag&quot;&gt;&amp;lt;ul&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;slide-list&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This should produce following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/src/slideshow/index.htm&quot;&gt;Click here&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;Drawsvg&lt;/h1&gt;
&lt;p&gt;Drawsvg.js is a jQuery plugin to draw svg images&lt;/p&gt;
&lt;p&gt;A Simple of drawsvg example as shown below &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;lang&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;en&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;charset&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;UTF-8&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;rel&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;shortcut icon&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;image/x-icon&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;favicon.ico&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;rel&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;stylesheet&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://fonts.googleapis.com/css?family=Open+Sans:400,600&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;rel&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;stylesheet&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;style.css&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;intro&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;container&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;overlay&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;inner&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
                  &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;jQuery DrawSVG Sample&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;

                  &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;items-wrapper&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
                     &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;item active&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class=&quot;tag&quot;&gt;&amp;lt;svg&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;viewBox&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;0 0 201 146&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;svgClass&quot;&lt;/span&gt; 
                           &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:#&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ffffff00&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; 
                              &lt;span class=&quot;atn&quot;&gt;xmlns&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://www.w3.org/2000/svg&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;201&quot;&lt;/span&gt;
                              &lt;span class=&quot;atn&quot;&gt;height&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;146&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
									
                           &lt;span class=&quot;tag&quot;&gt;&amp;lt;g&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;stroke&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;#FFF&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;stroke-width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;1&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;fill&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;none&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M200.5 128.586c0 9.302-7.678
                                 16.914-17.06 16.914H17.56C8.18 145.5.5 
                                 137.888.5 128.586V29.414C.5 20.112 8.178 
                                 12.5 17.56 12.5h165.88c9.382 0 17.06 
                                 7.612 17.06 16.914v99.172z&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
											
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M183.828 80.118c0 26.467-21.644 
                                 47.924-48.34 47.924-26.698 
                                 0-48.342-21.457-48.342-47.924s21.644-47.924 
                                 48.34-47.924c26.698 0 48.342 21.457 48.342
                                 47.924z&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
											
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M171.98 80.118c0 19.978-16.338
                                 36.177-36.493 36.177-20.15 
                                 0-36.49-16.2-36.49-36.177 0-19.98 
                                 16.34-36.177 36.49-36.177 20.155 0 
                                 36.494 16.2 36.494 36.178z&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
											
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M50.18 48.637c0 6.49-5.304 
                                 11.747-11.852 11.747-6.543
                                 0-11.847-5.258-11.847-11.747  0-6.488 
                                 5.305-11.746 11.848-11.746 6.548 0 11.852 
                                 5.26 11. 852 11.747z&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
											
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M17.928 39.877c3.41-7.835 
                                 11.258-13.305 20.416-13.305 9.16 0 17.006 
                                 5.47 20.416 13.305&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
											
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M46 12V4H26v8&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M94.833 12l11.5-11.5h59.5l11.5 11.5&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M26.333 92.5h35.5&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M26.333 105.5h43&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M26.333 117.5h52&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
                           &lt;span class=&quot;tag&quot;&gt;&amp;lt;/g&amp;gt;&lt;/span&gt;
									
                        &lt;span class=&quot;tag&quot;&gt;&amp;lt;/svg&amp;gt;&lt;/span&gt;
                     &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

                     &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;item&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class=&quot;tag&quot;&gt;&amp;lt;svg&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;viewBox&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;0 0 207 105&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:#&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ffffff00&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; 
                           &lt;span class=&quot;atn&quot;&gt;xmlns&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://www.w3.org/2000/svg&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;207&quot;&lt;/span&gt; 
                           &lt;span class=&quot;atn&quot;&gt;height&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;105&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
								
                           &lt;span class=&quot;tag&quot;&gt;&amp;lt;g&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;stroke&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;#FFF&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;stroke-width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;1&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;fill&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;none&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M127 63.496C127 85.306 144.455 
                                 103 165.998 103 187.538 103 205 85.306 
                                 205 63.496 205 41.682 187.537 24 165.998
                                 24 144.455 24 127 41.682 127 63.496z&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
											
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M195 63.497C195 47.206 182.015 34 166 34&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
										
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M2 63.496C2 85.306 19.455 103 
                                 41.002 103 62.542 103 80 85.306 80 63.496 
                                 80 41.682 62.54 24 41.002 24 19.455 24 2
                                 41.682 2 63.496z&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
											
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M64.296 22.732C57.656 18.094 
                                 47.492 16 41.002 16c-6.49 0-12.675 
                                 1.33-18.3 3.732-5.622 2.404-10.686 
                                 5.88-14.938 10.178&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
											
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M159.715 63.576c0 3.634 2.902 
                                 6.575 6.49 6.575 3.582 0 6.484-2.94 
                                 6.484-6.574 0-3.63-2.903-6.575-6.486-6.575-3.587
                                 0-6.49 2.946-6.49 6.576z&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
											
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M34.873 64.032c0 3.63 2.907 
                                 6.575 6.494 6.575 3.578 0 6.485-2.945 
                                 6.485-6.575  0-3.635-2.907-6.575-6.485-6.575-3.587 
                                 0-6.494 2.94-6.494 6.575z&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
											
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M163.25 57.026L141.773 3&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M98 63.5H48&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M101.73 57.63L70.5 14.013&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M70.49 14.5h76.646v-.206&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M139.134 14.505L108.468 57.95&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M70.894 15.05L42.834 57.05&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M70.5 14V3&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M141.427 3.23s19.83-7.71 19.83 6.344&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
										
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M97.816 62.52c0 3.576 2.86 6.475 
                                 6.39 6.475s6.392-2.9 
                                 6.392-6.476c0-3.577-2.86-6.476-6.39
                                 -6.476s-6.392 2.9-6.392 6.476z&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
											
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M106.642 69.26l2.913 11.044&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M105 83l10-5&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M62.5 3.5h18&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
                           &lt;span class=&quot;tag&quot;&gt;&amp;lt;/g&amp;gt;&lt;/span&gt;
									
                        &lt;span class=&quot;tag&quot;&gt;&amp;lt;/svg&amp;gt;&lt;/span&gt;
                     &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

                     &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;item&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class=&quot;tag&quot;&gt;&amp;lt;svg&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;viewBox&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;0 0 201 116&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:#&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ffffff00&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; 
                           &lt;span class=&quot;atn&quot;&gt;xmlns&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://www.w3.org/2000/svg&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;201&quot;&lt;/span&gt; 
                           &lt;span class=&quot;atn&quot;&gt;height&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;116&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
									
                           &lt;span class=&quot;tag&quot;&gt;&amp;lt;g&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;stroke&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;#FFF&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;stroke-width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;1&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;fill&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;none&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M19.5 101.5V6.45C19.5 3.176 23.12.5 
                                 26.402.5H175.53c3.282 0 5.97 2.677 5.97
                                 5.95v95.05&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
											
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M171.5 89.5h-140v-77h140v77z&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
										
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M200.5 107.526c0 1.635-1.344 
                                 2.974-2.985 2.974H3.485c-1.64 
                                 0-2.985-1.34-2.985-2.974v-3.052c0-1.635
                                 1.344-2.974 2.985-2.974h194.03c1.64 0 2.985 
                                 1.34 2.9852.974v3.052z&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
											
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M1 110l10.5 5.5&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M11.604 115.5H189.46&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M189.5 115.5l9.5-5.5&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M99.5 7.5h5&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M138.5 12.5l28 28&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M148.5 12.5l18 18&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M159.5 12.5l7 6&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
                           &lt;span class=&quot;tag&quot;&gt;&amp;lt;/g&amp;gt;&lt;/span&gt;
									
                        &lt;span class=&quot;tag&quot;&gt;&amp;lt;/svg&amp;gt;&lt;/span&gt;
                     &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

                     &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;item&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class=&quot;tag&quot;&gt;&amp;lt;svg&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;viewBox&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;0 0 200 155&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:#&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ffffff00&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; 
                           &lt;span class=&quot;atn&quot;&gt;xmlns&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://www.w3.org/2000/svg&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;200&quot;&lt;/span&gt; 
                           &lt;span class=&quot;atn&quot;&gt;height&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;155&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
									
                           &lt;span class=&quot;tag&quot;&gt;&amp;lt;g&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;stroke&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;#FFF&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;stroke-width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;1&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;fill&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;none&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;M161.996 151.39l-33.97-27.178-45.01 
                                 30.576-35.67-27.603L.36 154.245 38.662 20.04 
                                 80.893 4.034l39.066 17.41L161.995.213l37.792 
                                 22.932-37.792 128.246z&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
											
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M47.346 127.185L80.892 4.035&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M83.015 154.788l36.942-133.343&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M128.025 124.212l33.97-124&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M46.278 23.935L32.29 75.605&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M95.802 45.718L81.19 97.225&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M106.91 33.115l-22.26 81.39&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
										
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M176.768 46.665c0 3.523-2.85
                                 6.376-6.366 6.376-3.514 0-6.364-2.852
                                 -6.364-6.375 0-3.512 2.85-6.37
                                 6.364-6.37 3.516 0 6.366 2.858 
                                 6.366 6.37z&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
											
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M180.9 52.392l-10.844 
                                 19.91-10.394-19.995s-1.143-3.215-1.
                                 143-5.067c0-6.514 5.273-11.81 11.79-11.81 
                                 6.508 0 11.782 5.296 11.782 11.81 
                                 0 1.852-1.192 5.152-1.192 5.152z&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
											
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M43.86 92.528c0 3.523-2.85 
                                 6.376-6.367 6.376-3.514 0-6.364-2.
                                 853-6.364-6.376 0-3.512 2.85-6.37 
                                 6.363-6.37 3.517 0 6.366 2.858 
                                 6.366 6.37z&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
											
                              &lt;span class=&quot;tag&quot;&gt;&amp;lt;path&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;M47.99 98.255l-10.843 19.91L26.754 
                                 98.17s-1.143-3.215-1.
                                 143-5.067c0-6.514 5.275-11.81 
                                 11.793-11.81 6.507 0 11.78 5.296 
                                 11.78 11.81 0 1.852-1.192 
                                 5.152-1.192 5.152z&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
                           &lt;span class=&quot;tag&quot;&gt;&amp;lt;/g&amp;gt;&lt;/span&gt;
									
                        &lt;span class=&quot;tag&quot;&gt;&amp;lt;/svg&amp;gt;&lt;/span&gt;
                     &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
							
                  &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;fb-root&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;//assets.codepen.io/assets/embed/ei.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://cdn.jsdelivr.net/jquery/1.11.3/jquery.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://cdn.jsdelivr.net/jquery.easing/1.3/jquery.easing.1.3.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;jquery.drawsvg.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;

            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $doc &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            $win &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;

            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $intro &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;.intro&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            $items &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $intro&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;.item&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            itemsLen &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $items&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
				
            svgs &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $intro&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;svg&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;drawsvg&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               callback&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; animateIntro&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               easing&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;easeOutQuart&#39;&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
				
            currItem &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;

            &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; animateIntro&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               $items&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;removeClass&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;active&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;eq&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; currItem&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; itemsLen 
                  &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;addClass&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;active&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;svg&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;drawsvg&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;animate&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

            animateIntro&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;

            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $header &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;header&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            headerOffTop &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $header&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;offset&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            isFixed &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;

            &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; menu&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $win&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;scrollTop&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; headerOffTop &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;isFixed &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                     isFixed &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                     $header&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;addClass&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;affix&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
                  &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; isFixed &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  isFixed &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  $header&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;removeClass&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;affix&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

            $win&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;scroll&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; menu&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            menu&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

            $header&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;click&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;a[href^=&quot;#&quot;]&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               e&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;preventDefault&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;

               &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; hash &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;hash&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               offset &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;hash&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;offset&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

               $&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;body, html&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;animate&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  scrollTop&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; offset
               &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;600&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;easeInOutQuart&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;hash &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; hash&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;

         &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This should produce following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/src/drawsvg/index.htm&quot;&gt;Click here&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;Weather&lt;/h1&gt;
&lt;p&gt;Weather.js is a jQuery plugin to find the information about weather details.&lt;/p&gt;
&lt;p&gt;A Simple of Weather.js example as shown below &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;lang&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;en&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;charset&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;UTF-8&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;viewport&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;content&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;width = device-width, 
         initial-scale = 1&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;rel&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;stylesheet&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;rel&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;stylesheet&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.css&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&#39;https://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700&#39;&lt;/span&gt;
         &lt;span class=&quot;atn&quot;&gt;rel&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&#39;stylesheet&#39;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&#39;text/css&#39;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;rel&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;stylesheet&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/css&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;weather.css&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;weather-background&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;default-weather&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;canvas&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;rain-canvas&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/canvas&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;canvas&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;cloud-canvas&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/canvas&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;canvas&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;weather-canvas&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/canvas&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;canvas&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;time-canvas&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/canvas&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;canvas&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;lightning-canvas&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/canvas&amp;gt;&lt;/span&gt;
		
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;page-wrap&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;header&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;search-bar&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
			
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;search-text&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;search-location-text&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  What&#39;s the weather like in 
                  
                  &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;search-location-input&quot;&lt;/span&gt; 
                     &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;search-location-input&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text&quot;&lt;/span&gt;
                     &lt;span class=&quot;atn&quot;&gt;placeholder&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;City&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; ?
               &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
					
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;search-location-button-group&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;search-location-button&quot;&lt;/span&gt; 
                  &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;fa fa-search search-location-button search-button&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
                  &lt;span class=&quot;tag&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
						
               &lt;span class=&quot;com&quot;&gt;&amp;lt;!--  --&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;geo-button&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;geo-button fa
                  fa-location-arrow search-button&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
				
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/header&amp;gt;&lt;/span&gt;

         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;geo-error-message&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;geo-error-message hide&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&#39;close-error&#39;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&#39;fa fa-times 
               close-error&#39;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/button&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Uh oh! It looks like we can&#39;t 
               find your location. Please type your city into the search 
               box above!
         &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;front-page-description&quot;&lt;/span&gt; 
			   &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;front-page-description middle&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Blank Canvas Weather&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
			
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;attribution-links hide&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;attribution-links&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&#39;close-attribution&#39;&lt;/span&gt; 
               &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&#39;fa fa-times close-attribution&#39;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
					
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Icons from &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://thenounproject.com/&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               Noun Project&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
					
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;icon-attribution&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
                  &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://thenounproject.com/term/cloud/6852/&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  Cloud&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; by Pieter J. Smits&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
						
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;icon-attribution&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
                  &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://thenounproject.com/term/snow/64/&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  Snow&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; from National Park Service Collection&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
						
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;icon-attribution&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
                  &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://thenounproject.com/term/drop/11449/&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  Drop&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Alex Fuller&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
						
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;icon-attribution&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
                  &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://thenounproject.com/term/smoke/27750/&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  Smoke&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; by Gerardo Mart&amp;iacute;n Mart&amp;iacute;nez&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
						
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;icon-attribution&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
                  &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://thenounproject.com/term/moon/13554/&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  Moon&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; by Jory Raphael&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
						
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;icon-attribution&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
                  &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://thenounproject.com/term/warning/18974/&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  Warning&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; by Icomatic&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
						
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;icon-attribution&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
                  &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://thenounproject.com/term/sun/13545/&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  Sun&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; by Jory Raphael&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
						
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;icon-attribution&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
                  &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://thenounproject.com/term/windsock/135621/&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  Windsock&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; by Golden Roof&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
						
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;		
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
			
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;weather&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;weather middle hide&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;location&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;location&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
               
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;weather-container&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
                  &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;temperature-info&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;temperature-info&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
                     &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;temperature&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;temperature&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
                     &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
                     &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;weather-description&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;weather-description&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
                     &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
                  &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
						
                  &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;weather-box&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
                     &lt;span class=&quot;tag&quot;&gt;&amp;lt;ul&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;weather-info&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;weather-info&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;weather-item humidity&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Humidity:
                           &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;humidity&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/span&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;span class=&quot;com&quot;&gt;&amp;lt;!----&amp;gt;&lt;/span&gt;
                        &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;weather-item wind&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Wind: &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;span&lt;/span&gt; 
                           &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;wind-direction&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/span&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;&amp;lt;span&lt;/span&gt; 
                           &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;wind&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/span&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;&amp;lt;span&lt;/span&gt; 
                           &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;speed-unit&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
                     &lt;span class=&quot;tag&quot;&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
                  &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
						
                  &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;temp-change&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
                     &lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;celsius&quot;&lt;/span&gt; 
                        &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;temp-change-button celsius&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&amp;deg;C
                        &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/button&amp;gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;fahrenheit&quot;&lt;/span&gt; 
                        &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;temp-change-button fahrenheit&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                        &amp;deg;F&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
                  &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
						
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt; 
				
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
			
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; 
            &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;weather.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This should produce following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://www.tutorialspoint.com/jquery/src/weather/index.htm&quot;&gt;Click here&lt;/a&gt;&lt;/p&gt;
&lt;script&gt;mbtTOC();&lt;/script&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;http://feeds.feedburner.com/PostLinkSharing&lt;/div&gt;</description><link>https://plinksharing.blogspot.com/2021/02/learn-jquery.html</link><author>noreply@blogger.com (Arakkha Sênâ)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1955839799848409424.post-6261822226308306611</guid><pubDate>Thu, 18 Feb 2021 11:48:00 +0000</pubDate><atom:updated>2021-02-18T03:48:34.935-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">MYSQL</category><category domain="http://www.blogger.com/atom/ns#">Web Programs</category><title>MYSQL Tutorials</title><description>&lt;div class=&quot;mbtTOC&quot;&gt;
    &lt;button onclick=&quot;mbtToggle()&quot;&gt;Contents&lt;/button&gt;
    &lt;ol id=&quot;mbtTOC&quot;&gt;&lt;/ol&gt;
    &lt;/div&gt;
&lt;h1&gt;Introduction&lt;/h1&gt;
&lt;h2&gt;What is a Database?&lt;/h2&gt;
&lt;p&gt;A database is a separate application that stores a collection of data. Each database has one or more distinct APIs for creating, accessing, managing, searching and replicating the data it holds.&lt;/p&gt;
&lt;p&gt;Other kinds of data stores can also be used, such as files on the file system or large hash tables in memory but data fetching and writing would not be so fast and easy with those type of systems.&lt;/p&gt;
&lt;p&gt;Nowadays, we use relational database management systems (RDBMS) to store and manage huge volume of data. This is called relational database because all the data is stored into different tables and relations are established using primary keys or other keys known as&amp;nbsp;&lt;strong&gt;Foreign Keys&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;A&amp;nbsp;&lt;strong&gt;Relational DataBase Management System (RDBMS)&lt;/strong&gt;&amp;nbsp;is a software that &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;Enables you to implement a database with tables, columns and indexes.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Guarantees the Referential Integrity between rows of various tables.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Updates the indexes automatically.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Interprets an SQL query and combines information from various tables.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;RDBMS Terminology&lt;/h2&gt;
&lt;p&gt;Before we proceed to explain the MySQL database system, let us revise a few definitions related to the database.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Database&lt;/strong&gt;&amp;nbsp;&amp;minus; A database is a collection of tables, with related data.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Table&lt;/strong&gt;&amp;nbsp;&amp;minus; A table is a matrix with data. A table in a database looks like a simple spreadsheet.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Column&lt;/strong&gt;&amp;nbsp;&amp;minus; One column (data element) contains data of one and the same kind, for example the column postcode.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Row&lt;/strong&gt;&amp;nbsp;&amp;minus; A row (= tuple, entry or record) is a group of related data, for example the data of one subscription.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Redundancy&lt;/strong&gt;&amp;nbsp;&amp;minus; Storing data twice, redundantly to make the system faster.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Primary Key&lt;/strong&gt;&amp;nbsp;&amp;minus; A primary key is unique. A key value can not occur twice in one table. With a key, you can only find one row.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Foreign Key&lt;/strong&gt;&amp;nbsp;&amp;minus; A foreign key is the linking pin between two tables.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Compound Key&lt;/strong&gt;&amp;nbsp;&amp;minus; A compound key (composite key) is a key that consists of multiple columns, because one column is not sufficiently unique.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Index&lt;/strong&gt;&amp;nbsp;&amp;minus; An index in a database resembles an index at the back of a book.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Referential Integrity&lt;/strong&gt;&amp;nbsp;&amp;minus; Referential Integrity makes sure that a foreign key value always points to an existing row.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;MySQL Database&lt;/h2&gt;
&lt;p&gt;MySQL is a fast, easy-to-use RDBMS being used for many small and big businesses. MySQL is developed, marketed and supported by MySQL AB, which is a Swedish company. MySQL is becoming so popular because of many good reasons &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;MySQL is released under an open-source license. So you have nothing to pay to use it.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;MySQL is a very powerful program in its own right. It handles a large subset of the functionality of the most expensive and powerful database packages.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;MySQL uses a standard form of the well-known SQL data language.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;MySQL works on many operating systems and with many languages including PHP, PERL, C, C++, JAVA, etc.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;MySQL works very quickly and works well even with large data sets.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;MySQL is very friendly to PHP, the most appreciated language for web development.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;MySQL supports large databases, up to 50 million rows or more in a table. The default file size limit for a table is 4GB, but you can increase this (if your operating system can handle it) to a theoretical limit of 8 million terabytes (TB).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;MySQL is customizable. The open-source GPL license allows programmers to modify the MySQL software to fit their own specific environments.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Before You Begin&lt;/h2&gt;
&lt;p&gt;Before you begin this tutorial, you should have a basic knowledge of the information covered in our PHP and HTML tutorials.&lt;/p&gt;
&lt;p&gt;This tutorial focuses heavily on using MySQL in a PHP environment. Many examples given in this tutorial will be useful for PHP Programmers.&lt;/p&gt;
&lt;p&gt;We recommend you check our&amp;nbsp;&lt;a href=&quot;https://www.tutorialspoint.com/php/index.htm&quot;&gt;PHP Tutorial&lt;/a&gt;&amp;nbsp;for your reference.&lt;/p&gt;

&lt;h1&gt;Installation&lt;/h1&gt;
&lt;p&gt;All downloads for MySQL are located at&amp;nbsp;&lt;a href=&quot;https://www.mysql.com/downloads/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;MySQL Downloads&lt;/a&gt;. Pick the version number of&amp;nbsp;&lt;strong&gt;MySQL Community Server&lt;/strong&gt;&amp;nbsp;which is required along with the platform you will be running it on.&lt;/p&gt;
&lt;h2&gt;Installing MySQL on Linux/UNIX&lt;/h2&gt;
&lt;p&gt;The recommended way to install MySQL on a Linux system is via RPM. MySQL AB makes the following RPMs available for download on its website &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;MySQL&lt;/strong&gt;&amp;nbsp;&amp;minus; The MySQL database server manages the databases and tables, controls user access and processes the SQL queries.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;MySQL-client&lt;/strong&gt;&amp;nbsp;&amp;minus; MySQL client programs, which make it possible to connect to and interact with the server.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;MySQL-devel&lt;/strong&gt;&amp;nbsp;&amp;minus; Libraries and header files that come in handy when compiling other programs that use MySQL.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;MySQL-shared&lt;/strong&gt;&amp;nbsp;&amp;minus; Shared libraries for the MySQL client.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;MySQL-bench&lt;/strong&gt;&amp;nbsp;&amp;minus; Benchmark and performance testing tools for the MySQL database server.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The MySQL RPMs listed here are all built on a&amp;nbsp;&lt;strong&gt;SuSE Linux system&lt;/strong&gt;, but they will usually work on other Linux variants with no difficulty.&lt;/p&gt;
&lt;p&gt;Now, you will need to adhere to the steps given below, to proceed with the installation &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;Login to the system using the&amp;nbsp;&lt;strong&gt;root&lt;/strong&gt;&amp;nbsp;user.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Switch to the directory containing the RPMs.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Install the MySQL database server by executing the following command. Remember to replace the filename in italics with the file name of your RPM.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;[root@host]# rpm -i MySQL-5.0.9-0.i386.rpm
&lt;/pre&gt;
&lt;p&gt;The above command takes care of installing the MySQL server, creating a user of MySQL, creating necessary configuration and starting the MySQL server automatically.&lt;/p&gt;
&lt;p&gt;You can find all the MySQL related binaries in /usr/bin and /usr/sbin. All the tables and databases will be created in the /var/lib/mysql directory.&lt;/p&gt;
&lt;p&gt;The following code box has an optional but recommended step to install the remaining RPMs in the same manner &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;[root@host]# rpm -i MySQL-client-5.0.9-0.i386.rpm
[root@host]# rpm -i MySQL-devel-5.0.9-0.i386.rpm
[root@host]# rpm -i MySQL-shared-5.0.9-0.i386.rpm
[root@host]# rpm -i MySQL-bench-5.0.9-0.i386.rpm
&lt;/pre&gt;
&lt;h2&gt;Installing MySQL on Windows&lt;/h2&gt;
&lt;p&gt;The default installation on any version of Windows is now much easier than it used to be, as MySQL now comes neatly packaged with an installer. Simply download the installer package, unzip it anywhere and run the setup.exe file.&lt;/p&gt;
&lt;p&gt;The default installer setup.exe will walk you through the trivial process and by default will install everything under C:\mysql.&lt;/p&gt;
&lt;p&gt;Test the server by firing it up from the command prompt the first time. Go to the location of the&amp;nbsp;&lt;strong&gt;mysqld server&lt;/strong&gt;&amp;nbsp;which is probably C:\mysql\bin, and type &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;mysqld.exe --console
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;&amp;nbsp;&amp;minus; If you are on NT, then you will have to use mysqld-nt.exe instead of mysqld.exe&lt;/p&gt;
&lt;p&gt;If all went well, you will see some messages about startup and&amp;nbsp;&lt;strong&gt;InnoDB&lt;/strong&gt;. If not, you may have a permissions issue. Make sure that the directory that holds your data is accessible to whatever user (probably MySQL) the database processes run under.&lt;/p&gt;
&lt;p&gt;MySQL will not add itself to the start menu, and there is no particularly nice GUI way to stop the server either. Therefore, if you tend to start the server by double clicking the mysqld executable, you should remember to halt the process by hand by using mysqladmin, Task List, Task Manager, or other Windows-specific means.&lt;/p&gt;
&lt;h2&gt;Verifying MySQL Installation&lt;/h2&gt;
&lt;p&gt;After MySQL, has been successfully installed, the base tables have been initialized and the server has been started: you can verify that everything is working as it should be via some simple tests.&lt;/p&gt;
&lt;h3&gt;Use the mysqladmin Utility to Obtain Server Status&lt;/h3&gt;
&lt;p&gt;Use&amp;nbsp;&lt;strong&gt;mysqladmin&lt;/strong&gt;&amp;nbsp;binary to check the server version. This binary would be available in /usr/bin on linux and in C:\mysql\bin on windows.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;[root@host]# mysqladmin --version
&lt;/pre&gt;
&lt;p&gt;It will produce the following result on Linux. It may vary depending on your installation &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;mysqladmin  Ver 8.23 Distrib 5.0.9-0, for redhat-linux-gnu on i386
&lt;/pre&gt;
&lt;p&gt;If you do not get such a message, then there may be some problem in your installation and you would need some help to fix it.&lt;/p&gt;
&lt;h3&gt;Execute simple SQL commands using the MySQL Client&lt;/h3&gt;
&lt;p&gt;You can connect to your MySQL server through the MySQL client and by using the&amp;nbsp;&lt;strong&gt;mysql&lt;/strong&gt;command. At this moment, you do not need to give any password as by default it will be set as blank.&lt;/p&gt;
&lt;p&gt;You can just use following command &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;[root@host]# mysql
&lt;/pre&gt;
&lt;p&gt;It should be rewarded with a mysql&amp;gt; prompt. Now, you are connected to the MySQL server and you can execute all the SQL commands at the mysql&amp;gt; prompt as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;mysql&amp;gt; SHOW DATABASES;
+----------+
| Database |
+----------+
|   mysql  | 
|   test   |  
+----------+
2 rows in set (0.13 sec)
&lt;/pre&gt;
&lt;h2&gt;Post-installation Steps&lt;/h2&gt;
&lt;p&gt;MySQL ships with a blank password for the root MySQL user. As soon as you have successfully installed the database and the client, you need to set a root password as given in the following code block &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;[root@host]# mysqladmin -u root password &quot;new_password&quot;;
&lt;/pre&gt;
&lt;p&gt;Now to make a connection to your MySQL server, you would have to use the following command &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;[root@host]# mysql -u root -p
Enter password:*******
&lt;/pre&gt;
&lt;p&gt;UNIX users will also want to put your MySQL directory in your PATH, so you won&#39;t have to keep typing out the full path everytime you want to use the command-line client.&lt;/p&gt;
&lt;p&gt;For bash, it would be something like &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;export PATH = $PATH:/usr/bin:/usr/sbin
&lt;/pre&gt;
&lt;h2&gt;Running MySQL at Boot Time&lt;/h2&gt;
&lt;p&gt;If you want to run the MySQL server at boot time, then make sure you have the following entry in the /etc/rc.local file.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;/etc/init.d/mysqld start
&lt;/pre&gt;
&lt;p&gt;Also,you should have the mysqld binary in the /etc/init.d/ directory.&lt;/p&gt;

&lt;h1&gt;Administration&lt;/h1&gt;
&lt;h2&gt;Running and Shutting down MySQL Server&lt;/h2&gt;
&lt;p&gt;First check if your MySQL server is running or not. You can use the following command to check it &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;ps -ef | grep mysqld
&lt;/pre&gt;
&lt;p&gt;If your MySql is running, then you will see&amp;nbsp;&lt;strong&gt;mysqld&lt;/strong&gt;&amp;nbsp;process listed out in your result. If server is not running, then you can start it by using the following command &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;root@host# cd /usr/bin
./safe_mysqld &amp;amp;
&lt;/pre&gt;
&lt;p&gt;Now, if you want to shut down an already running MySQL server, then you can do it by using the following command &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;root@host# cd /usr/bin
./mysqladmin -u root -p shutdown
Enter password: ******
&lt;/pre&gt;
&lt;h2&gt;Setting Up a MySQL User Account&lt;/h2&gt;
&lt;p&gt;For adding a new user to MySQL, you just need to add a new entry to the&amp;nbsp;&lt;strong&gt;user&lt;/strong&gt;&amp;nbsp;table in the database&amp;nbsp;&lt;strong&gt;mysql&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The following program is an example of adding a new user&amp;nbsp;&lt;strong&gt;guest&lt;/strong&gt;&amp;nbsp;with SELECT, INSERT and UPDATE privileges with the password&amp;nbsp;&lt;strong&gt;guest123;&lt;/strong&gt;&amp;nbsp;the SQL query is &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;root@host&lt;/span&gt;&lt;span class=&quot;com&quot;&gt;# mysql -u root -p&lt;/span&gt;
&lt;span class=&quot;typ&quot;&gt;Enter&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; password&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:*******&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
mysql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;typ&quot;&gt;Database&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; changed

mysql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; INSERT INTO user 
   &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;host&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; user&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; password&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
   select_priv&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; insert_priv&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; update_priv&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
   VALUES &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;localhost&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;guest&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
   PASSWORD&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;guest123&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Y&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Y&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Y&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;typ&quot;&gt;Query&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; OK&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; row affected &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0.20&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; sec&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

mysql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; FLUSH PRIVILEGES&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;typ&quot;&gt;Query&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; OK&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; row affected &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0.01&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; sec&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

mysql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; SELECT host&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; user&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; password FROM user WHERE user &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;guest&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;+-----------+---------+------------------+&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;    host   &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;   user  &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;     password     &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;|&lt;/span&gt;    
&lt;span class=&quot;pun&quot;&gt;+-----------+---------+------------------+&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; localhost &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;  guest  &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;6f8c114b58f2ce9e&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;|&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;+-----------+---------+------------------+&lt;/span&gt;
&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; row &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0.00&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; sec&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;When adding a new user, remember to encrypt the new password using PASSWORD() function provided by MySQL. As you can see in the above example, the password mypass is encrypted to 6f8c114b58f2ce9e.&lt;/p&gt;
&lt;p&gt;Notice the FLUSH PRIVILEGES statement. This tells the server to reload the grant tables. If you don&#39;t use it, then you won&#39;t be able to connect to MySQL using the new user account at least until the server is rebooted.&lt;/p&gt;
&lt;p&gt;You can also specify other privileges to a new user by setting the values of following columns in user table to &#39;Y&#39; when executing the INSERT query or you can update them later using UPDATE query.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;Select_priv&lt;/li&gt;
&lt;li&gt;Insert_priv&lt;/li&gt;
&lt;li&gt;Update_priv&lt;/li&gt;
&lt;li&gt;Delete_priv&lt;/li&gt;
&lt;li&gt;Create_priv&lt;/li&gt;
&lt;li&gt;Drop_priv&lt;/li&gt;
&lt;li&gt;Reload_priv&lt;/li&gt;
&lt;li&gt;Shutdown_priv&lt;/li&gt;
&lt;li&gt;Process_priv&lt;/li&gt;
&lt;li&gt;File_priv&lt;/li&gt;
&lt;li&gt;Grant_priv&lt;/li&gt;
&lt;li&gt;References_priv&lt;/li&gt;
&lt;li&gt;Index_priv&lt;/li&gt;
&lt;li&gt;Alter_priv&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Another way of adding user account is by using GRANT SQL command. The following example will add user&amp;nbsp;&lt;strong&gt;zara&lt;/strong&gt;&amp;nbsp;with password&amp;nbsp;&lt;strong&gt;zara123&lt;/strong&gt;&amp;nbsp;for a particular database, which is named as&amp;nbsp;&lt;strong&gt;TUTORIALS&lt;/strong&gt;.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;root@host&lt;/span&gt;&lt;span class=&quot;com&quot;&gt;# mysql -u root -p password;&lt;/span&gt;
&lt;span class=&quot;typ&quot;&gt;Enter&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; password&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:*******&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
mysql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;typ&quot;&gt;Database&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; changed

mysql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; GRANT SELECT&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;INSERT&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;UPDATE&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;DELETE&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;CREATE&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;DROP
   &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; ON TUTORIALS&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.*&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; TO &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;zara&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;localhost&#39;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; IDENTIFIED BY &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;zara123&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will also create an entry in the MySQL database table called as&amp;nbsp;&lt;strong&gt;user&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;&amp;nbsp;&amp;minus; MySQL does not terminate a command until you give a semi colon (;) at the end of the SQL command.&lt;/p&gt;
&lt;h3&gt;The /etc/my.cnf File Configuration&lt;/h3&gt;
&lt;p&gt;In most of the cases, you should not touch this file. By default, it will have the following entries &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;mysqld&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
datadir &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;/var/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;lib&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;mysql
socket &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;/var/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;lib&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;mysql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;mysql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;sock

&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;mysql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;server&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
user &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql
basedir &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;/var/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;lib

&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;safe_mysqld&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
err&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;/var/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;mysqld&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log
pid&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;file &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;/var/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;run&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;mysqld&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;mysqld&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;pid&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Here, you can specify a different directory for the error log, otherwise you should not change any entry in this table.&lt;/p&gt;
&lt;h2&gt;Administrative MySQL Command&lt;/h2&gt;
&lt;p&gt;Here is the list of the important MySQL commands, which you will use time to time to work with MySQL database &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;USE Databasename&lt;/strong&gt;&amp;nbsp;&amp;minus; This will be used to select a database in the MySQL workarea.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;SHOW DATABASES&lt;/strong&gt;&amp;nbsp;&amp;minus; Lists out the databases that are accessible by the MySQL DBMS.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;SHOW TABLES&lt;/strong&gt;&amp;nbsp;&amp;minus; Shows the tables in the database once a database has been selected with the use command.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;SHOW COLUMNS FROM&amp;nbsp;&lt;em&gt;tablename:&lt;/em&gt;&lt;/strong&gt;&amp;nbsp;Shows the attributes, types of attributes, key information, whether NULL is permitted, defaults, and other information for a table.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;SHOW INDEX FROM tablename&lt;/strong&gt;&amp;nbsp;&amp;minus; Presents the details of all indexes on the table, including the PRIMARY KEY.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;SHOW TABLE STATUS LIKE tablename\G&lt;/strong&gt;&amp;nbsp;&amp;minus; Reports details of the MySQL DBMS performance and statistics.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In the next chapter, we will discuss regarding how PHP Syntax is used in MySQL.&lt;/p&gt;

&lt;h1&gt;PHP Syntax&lt;/h1&gt;
&lt;p&gt;MySQL works very well in combination of various programming languages like PERL, C, C++, JAVA and PHP. Out of these languages, PHP is the most popular one because of its web application development capabilities.&lt;/p&gt;
&lt;p&gt;This tutorial focuses heavily on using MySQL in a PHP environment. If you are interested in MySQL with PERL, then you can consider reading the&amp;nbsp;&lt;a href=&quot;https://www.tutorialspoint.com/perl/perl_database.htm&quot;&gt;PERL&lt;/a&gt;&amp;nbsp;Tutorial.&lt;/p&gt;
&lt;p&gt;PHP provides various functions to access the MySQL database and to manipulate the data records inside the MySQL database. You would require to call the PHP functions in the same way you call any other PHP function.&lt;/p&gt;
&lt;p&gt;The PHP functions for use with MySQL have the following general format &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;mysql_&lt;em&gt;function&lt;/em&gt;(value,value,...);
&lt;/pre&gt;
&lt;p&gt;The second part of the function name is specific to the function, usually a word that describes what the function does. The following are two of the functions, which we will use in our tutorial &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;mysqli_connect($connect);
mysqli_query($connect,&quot;SQL statement&quot;);
&lt;/pre&gt;
&lt;p&gt;The following example shows a generic syntax of PHP to call any MySQL function.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;PHP with MySQL&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;php
         $retval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_&lt;/span&gt;&lt;em&gt;&lt;span class=&quot;pln&quot;&gt;function&lt;/span&gt;&lt;/em&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,...]);&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$retval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;die&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Error: a related error message&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;// Otherwise MySQL  or PHP Statements&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;?&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Starting from the next chapter, we will see all the important MySQL functionality along with PHP.&lt;/p&gt;

&lt;h1&gt;Connection&lt;/h1&gt;
&lt;h2&gt;MySQL Connection Using MySQL Binary&lt;/h2&gt;
&lt;p&gt;You can establish the MySQL database using the&amp;nbsp;&lt;strong&gt;mysql&lt;/strong&gt;&amp;nbsp;binary at the command prompt.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Here is a simple example to connect to the MySQL server from the command prompt &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;[root@host]# mysql -u root -p
Enter password:******
&lt;/pre&gt;
&lt;p&gt;This will give you the mysql&amp;gt; command prompt where you will be able to execute any SQL command. Following is the result of above command &amp;minus;&lt;/p&gt;
&lt;p&gt;The following code block shows the result of above code &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2854760 to server version: 5.0.9

Type &#39;help;&#39; or &#39;\h&#39; for help. Type &#39;\c&#39; to clear the buffer.
&lt;/pre&gt;
&lt;p&gt;In the above example, we have used&amp;nbsp;&lt;strong&gt;root&lt;/strong&gt;&amp;nbsp;as a user but you can use any other user as well. Any user will be able to perform all the SQL operations, which are allowed to that user.&lt;/p&gt;
&lt;p&gt;You can disconnect from the MySQL database any time using the&amp;nbsp;&lt;strong&gt;exit&lt;/strong&gt;&amp;nbsp;command at mysql&amp;gt; prompt.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;mysql&amp;gt; exit
Bye
&lt;/pre&gt;
&lt;h2&gt;MySQL Connection Using PHP Script&lt;/h2&gt;
&lt;p&gt;PHP provides&amp;nbsp;&lt;strong&gt;mysql_connect()&lt;/strong&gt;&amp;nbsp;function to open a database connection. This function takes five parameters and returns a MySQL link identifier on success or FALSE on failure.&lt;/p&gt;
&lt;h3&gt;Syntax&lt;/h3&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;connection mysql_connect(server,user,passwd,new_link,client_flag);
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Sr.No.&lt;/th&gt;
&lt;th&gt;Parameter &amp;amp; Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;1&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;server&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Optional &amp;minus; The host name running the database server. If not specified, then the default value will be&amp;nbsp;&lt;strong&gt;localhost:3306&lt;/strong&gt;.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;2&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;user&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Optional &amp;minus; The username accessing the database. If not specified, then the default will be the name of the user that owns the server process.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;3&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;passwd&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Optional &amp;minus; The password of the user accessing the database. If not specified, then the default will be an empty password.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;4&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;new_link&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Optional &amp;minus; If a second call is made to mysql_connect() with the same arguments, no new connection will be established; instead, the identifier of the already opened connection will be returned.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;5&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;client_flags&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Optional &amp;minus; A combination of the following constants &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;MYSQL_CLIENT_SSL &amp;minus; Use SSL encryption.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;MYSQL_CLIENT_COMPRESS &amp;minus; Use compression protocol.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;MYSQL_CLIENT_IGNORE_SPACE &amp;minus; Allow space after function names.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;MYSQL_CLIENT_INTERACTIVE &amp;minus; Allow interactive timeout seconds of inactivity before closing the connection.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;You can disconnect from the MySQL database anytime using another PHP function&amp;nbsp;&lt;strong&gt;mysql_close()&lt;/strong&gt;. This function takes a single parameter, which is a connection returned by the&amp;nbsp;&lt;strong&gt;mysql_connect()&lt;/strong&gt;&amp;nbsp;function.&lt;/p&gt;
&lt;h3&gt;Syntax&lt;/h3&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;bool mysql_close ( resource $link_identifier );
&lt;/pre&gt;
&lt;p&gt;If a resource is not specified, then the last opened database is closed. This function returns true if it closes the connection successfully otherwise it returns false.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Try the following example to connect to a MySQL server &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Connecting MySQL Server&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;php
         $dbhost &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;localhost:3306&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $dbuser &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;guest&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $dbpass &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;guest123&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_connect&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$dbhost&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $dbuser&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $dbpass&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         
         &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;die&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Could not connect: &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         echo &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Connected successfully&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         mysql_close&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$conn&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;?&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;h1&gt;Create Database&lt;/h1&gt;
&lt;h2&gt;Create Database Using mysqladmin&lt;/h2&gt;
&lt;p&gt;You would need special privileges to create or to delete a MySQL database. So assuming you have access to the root user, you can create any database using the mysql&amp;nbsp;&lt;strong&gt;mysqladmin&lt;/strong&gt;&amp;nbsp;binary.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Here is a simple example to create a database called&amp;nbsp;&lt;strong&gt;TUTORIALS&lt;/strong&gt;&amp;nbsp;&amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;[root@host]# mysqladmin -u root -p create TUTORIALS
Enter password:******
&lt;/pre&gt;
&lt;p&gt;This will create a MySQL database called TUTORIALS.&lt;/p&gt;
&lt;h2&gt;Create a Database using PHP Script&lt;/h2&gt;
&lt;p&gt;PHP uses&amp;nbsp;&lt;strong&gt;mysql_query&lt;/strong&gt;&amp;nbsp;function to create or delete a MySQL database. This function takes two parameters and returns TRUE on success or FALSE on failure.&lt;/p&gt;
&lt;h3&gt;Syntax&lt;/h3&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;bool mysql_query( sql, connection );
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Sr.No.&lt;/th&gt;
&lt;th&gt;Parameter &amp;amp; Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;1&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;sql&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Required - SQL query to create or delete a MySQL database&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;2&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;connection&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Optional - if not specified, then the last opened connection by mysql_connect will be used.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;The following example to create a database &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Creating MySQL Database&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;php
         $dbhost &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;localhost:3036&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $dbuser &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;root&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $dbpass &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;rootpassword&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_connect&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$dbhost&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $dbuser&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $dbpass&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         
         &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;die&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Could not connect: &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         echo &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Connected successfully&amp;lt;br /&amp;gt;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $sql &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;CREATE DATABASE TUTORIALS&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $retval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_query&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $sql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         
         &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $retval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;die&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Could not create database: &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         echo &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Database TUTORIALS created successfully\n&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         mysql_close&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$conn&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;?&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;h1&gt;Drop Database&lt;/h1&gt;
&lt;h2&gt;Drop a Database using mysqladmin&lt;/h2&gt;
&lt;p&gt;You would need special privileges to create or to delete a MySQL database. So, assuming you have access to the root user, you can create any database using the mysql&amp;nbsp;&lt;strong&gt;mysqladmin&lt;/strong&gt;&amp;nbsp;binary.&lt;/p&gt;
&lt;p&gt;Be careful while deleting any database because you will lose your all the data available in your database.&lt;/p&gt;
&lt;p&gt;Here is an example to delete a database(TUTORIALS) created in the previous chapter &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;[root@host]# mysqladmin -u root -p drop TUTORIALS
Enter password:******
&lt;/pre&gt;
&lt;p&gt;This will give you a warning and it will confirm if you really want to delete this database or not.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;Dropping the database is potentially a very bad thing to do.
Any data stored in the database will be destroyed.

Do you really want to drop the &#39;TUTORIALS&#39; database [y/N] y
Database &quot;TUTORIALS&quot; dropped
&lt;/pre&gt;
&lt;h2&gt;Drop Database using PHP Script&lt;/h2&gt;
&lt;p&gt;PHP uses&amp;nbsp;&lt;strong&gt;mysql_query&lt;/strong&gt;&amp;nbsp;function to create or delete a MySQL database. This function takes two parameters and returns TRUE on success or FALSE on failure.&lt;/p&gt;
&lt;h3&gt;Syntax&lt;/h3&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;bool mysql_query( sql, connection );
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Sr.No&lt;/th&gt;
&lt;th&gt;Parameter &amp;amp; Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;1&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;sql&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Required &amp;minus; SQL query to create or delete a MySQL database&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;2&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;connection&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Optional &amp;minus; if not specified, then the last opened connection by mysql_connect will be used.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Try the following example to delete a database &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Deleting MySQL Database&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;php
         $dbhost &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;localhost:3036&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $dbuser &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;root&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $dbpass &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;rootpassword&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_connect&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$dbhost&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $dbuser&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $dbpass&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         
         &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;die&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Could not connect: &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         echo &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Connected successfully&amp;lt;br /&amp;gt;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $sql &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;DROP DATABASE TUTORIALS&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $retval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_query&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $sql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         
         &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $retval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;die&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Could not delete database: &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         echo &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Database TUTORIALS deleted successfully\n&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         mysql_close&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$conn&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;?&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;WARNING&lt;/strong&gt;&amp;nbsp;&amp;minus; While deleting a database using the PHP script, it does not prompt you for any confirmation. So be careful while deleting a MySQL database.&lt;/p&gt;

&lt;h1&gt;Select Database&lt;/h1&gt;
&lt;p&gt;Once you get connected with the MySQL server, it is required to select a database to work with. This is because there might be more than one database available with the MySQL Server.&lt;/p&gt;
&lt;h2&gt;Selecting MySQL Database from the Command Prompt&lt;/h2&gt;
&lt;p&gt;It is very simple to select a database from the mysql&amp;gt; prompt. You can use the SQL command&amp;nbsp;&lt;strong&gt;use&lt;/strong&gt;&amp;nbsp;to select a database.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Here is an example to select a database called&amp;nbsp;&lt;strong&gt;TUTORIALS&lt;/strong&gt;&amp;nbsp;&amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;[root@host]# mysql -u root -p
Enter password:******
mysql&amp;gt; use TUTORIALS;
Database changed
mysql&amp;gt; 
&lt;/pre&gt;
&lt;p&gt;Now, you have selected the TUTORIALS database and all the subsequent operations will be performed on the TUTORIALS database.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;&amp;nbsp;&amp;minus; All the database names, table names, table fields name are case sensitive. So you would have to use the proper names while giving any SQL command.&lt;/p&gt;
&lt;h2&gt;Selecting a MySQL Database Using PHP Script&lt;/h2&gt;
&lt;p&gt;PHP provides function&amp;nbsp;&lt;strong&gt;mysql_select_db&lt;/strong&gt;&amp;nbsp;to select a database. It returns TRUE on success or FALSE on failure.&lt;/p&gt;
&lt;h3&gt;Syntax&lt;/h3&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;bool mysql_select_db( db_name, connection );
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Sr.No.&lt;/th&gt;
&lt;th&gt;Parameter &amp;amp; Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;1&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;db_name&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Required &amp;minus; MySQL Database name to be selected&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;2&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;connection&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Optional &amp;minus; if not specified, then the last opened connection by mysql_connect will be used.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Here is an example showing you how to select a database.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Selecting MySQL Database&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;php
         $dbhost &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;localhost:3036&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $dbuser &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;guest&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $dbpass &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;guest123&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_connect&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$dbhost&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $dbuser&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $dbpass&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         
         &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;die&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Could not connect: &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         echo &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Connected successfully&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         mysql_select_db&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;TUTORIALS&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
         mysql_close&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$conn&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;?&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;h1&gt;Data Types&lt;/h1&gt;
&lt;p&gt;Properly defining the fields in a table is important to the overall optimization of your database. You should use only the type and size of field you really need to use. For example, do not define a field 10 characters wide, if you know you are only going to use 2 characters. These type of fields (or columns) are also referred to as data types, after the&amp;nbsp;&lt;strong&gt;type of data&lt;/strong&gt;&amp;nbsp;you will be storing in those fields.&lt;/p&gt;
&lt;p&gt;MySQL uses many different data types broken into three categories &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;Numeric&lt;/li&gt;
&lt;li&gt;Date and Time&lt;/li&gt;
&lt;li&gt;String Types.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let us now discuss them in detail.&lt;/p&gt;
&lt;h2&gt;Numeric Data Types&lt;/h2&gt;
&lt;p&gt;MySQL uses all the standard ANSI SQL numeric data types, so if you&#39;re coming to MySQL from a different database system, these definitions will look familiar to you.&lt;/p&gt;
&lt;p&gt;The following list shows the common numeric data types and their descriptions &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;INT&lt;/strong&gt;&amp;nbsp;&amp;minus; A normal-sized integer that can be signed or unsigned. If signed, the allowable range is from -2147483648 to 2147483647. If unsigned, the allowable range is from 0 to 4294967295. You can specify a width of up to 11 digits.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;TINYINT&lt;/strong&gt;&amp;nbsp;&amp;minus; A very small integer that can be signed or unsigned. If signed, the allowable range is from -128 to 127. If unsigned, the allowable range is from 0 to 255. You can specify a width of up to 4 digits.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;SMALLINT&lt;/strong&gt;&amp;nbsp;&amp;minus; A small integer that can be signed or unsigned. If signed, the allowable range is from -32768 to 32767. If unsigned, the allowable range is from 0 to 65535. You can specify a width of up to 5 digits.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;MEDIUMINT&lt;/strong&gt;&amp;nbsp;&amp;minus; A medium-sized integer that can be signed or unsigned. If signed, the allowable range is from -8388608 to 8388607. If unsigned, the allowable range is from 0 to 16777215. You can specify a width of up to 9 digits.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;BIGINT&lt;/strong&gt;&amp;nbsp;&amp;minus; A large integer that can be signed or unsigned. If signed, the allowable range is from -9223372036854775808 to 9223372036854775807. If unsigned, the allowable range is from 0 to 18446744073709551615. You can specify a width of up to 20 digits.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;FLOAT(M,D)&lt;/strong&gt;&amp;nbsp;&amp;minus; A floating-point number that cannot be unsigned. You can define the display length (M) and the number of decimals (D). This is not required and will default to 10,2, where 2 is the number of decimals and 10 is the total number of digits (including decimals). Decimal precision can go to 24 places for a FLOAT.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;DOUBLE(M,D)&lt;/strong&gt;&amp;nbsp;&amp;minus; A double precision floating-point number that cannot be unsigned. You can define the display length (M) and the number of decimals (D). This is not required and will default to 16,4, where 4 is the number of decimals. Decimal precision can go to 53 places for a DOUBLE. REAL is a synonym for DOUBLE.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;DECIMAL(M,D)&lt;/strong&gt;&amp;nbsp;&amp;minus; An unpacked floating-point number that cannot be unsigned. In the unpacked decimals, each decimal corresponds to one byte. Defining the display length (M) and the number of decimals (D) is required. NUMERIC is a synonym for DECIMAL.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Date and Time Types&lt;/h2&gt;
&lt;p&gt;The MySQL date and time datatypes are as follows &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;DATE&lt;/strong&gt;&amp;nbsp;&amp;minus; A date in YYYY-MM-DD format, between 1000-01-01 and 9999-12-31. For example, December 30&lt;sup&gt;th&lt;/sup&gt;, 1973 would be stored as 1973-12-30.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;DATETIME&lt;/strong&gt;&amp;nbsp;&amp;minus; A date and time combination in YYYY-MM-DD HH:MM:SS format, between 1000-01-01 00:00:00 and 9999-12-31 23:59:59. For example, 3:30 in the afternoon on December 30&lt;sup&gt;th&lt;/sup&gt;, 1973 would be stored as 1973-12-30 15:30:00.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;TIMESTAMP&lt;/strong&gt;&amp;nbsp;&amp;minus; A timestamp between midnight, January 1&lt;sup&gt;st&lt;/sup&gt;, 1970 and sometime in 2037. This looks like the previous DATETIME format, only without the hyphens between numbers; 3:30 in the afternoon on December 30&lt;sup&gt;th&lt;/sup&gt;, 1973 would be stored as 19731230153000 ( YYYYMMDDHHMMSS ).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;TIME&lt;/strong&gt;&amp;nbsp;&amp;minus; Stores the time in a HH:MM:SS format.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;YEAR(M)&lt;/strong&gt;&amp;nbsp;&amp;minus; Stores a year in a 2-digit or a 4-digit format. If the length is specified as 2 (for example YEAR(2)), YEAR can be between 1970 to 2069 (70 to 69). If the length is specified as 4, then YEAR can be 1901 to 2155. The default length is 4.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;String Types&lt;/h2&gt;
&lt;p&gt;Although the numeric and date types are fun, most data you&#39;ll store will be in a string format. This list describes the common string datatypes in MySQL.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;CHAR(M)&lt;/strong&gt;&amp;nbsp;&amp;minus; A fixed-length string between 1 and 255 characters in length (for example CHAR(5)), right-padded with spaces to the specified length when stored. Defining a length is not required, but the default is 1.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;VARCHAR(M)&lt;/strong&gt;&amp;nbsp;&amp;minus; A variable-length string between 1 and 255 characters in length. For example, VARCHAR(25). You must define a length when creating a VARCHAR field.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;BLOB or TEXT&lt;/strong&gt;&amp;nbsp;&amp;minus; A field with a maximum length of 65535 characters. BLOBs are &quot;Binary Large Objects&quot; and are used to store large amounts of binary data, such as images or other types of files. Fields defined as TEXT also hold large amounts of data. The difference between the two is that the sorts and comparisons on the stored data are&amp;nbsp;&lt;strong&gt;case sensitive&lt;/strong&gt;&amp;nbsp;on BLOBs and are&amp;nbsp;&lt;strong&gt;not case sensitive&lt;/strong&gt;&amp;nbsp;in TEXT fields. You do not specify a length with BLOB or TEXT.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;TINYBLOB or TINYTEXT&lt;/strong&gt;&amp;nbsp;&amp;minus; A BLOB or TEXT column with a maximum length of 255 characters. You do not specify a length with TINYBLOB or TINYTEXT.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;MEDIUMBLOB or MEDIUMTEXT&lt;/strong&gt;&amp;nbsp;&amp;minus; A BLOB or TEXT column with a maximum length of 16777215 characters. You do not specify a length with MEDIUMBLOB or MEDIUMTEXT.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;LONGBLOB or LONGTEXT&lt;/strong&gt;&amp;nbsp;&amp;minus; A BLOB or TEXT column with a maximum length of 4294967295 characters. You do not specify a length with LONGBLOB or LONGTEXT.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;ENUM&lt;/strong&gt;&amp;nbsp;&amp;minus; An enumeration, which is a fancy term for list. When defining an ENUM, you are creating a list of items from which the value must be selected (or it can be NULL). For example, if you wanted your field to contain &quot;A&quot; or &quot;B&quot; or &quot;C&quot;, you would define your ENUM as ENUM (&#39;A&#39;, &#39;B&#39;, &#39;C&#39;) and only those values (or NULL) could ever populate that field.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In the next chapter, we will discuss how to create tables in MySQL.&lt;/p&gt;

&lt;h1&gt;Create Table&lt;/h1&gt;
&lt;p&gt;To begin with, the table creation command requires the following details &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;Name of the table&lt;/li&gt;
&lt;li&gt;Name of the fields&lt;/li&gt;
&lt;li&gt;Definitions for each field&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Syntax&lt;/h3&gt;
&lt;p&gt;Here is a generic SQL syntax to create a MySQL table &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;CREATE TABLE table_name (column_name column_type);
&lt;/pre&gt;
&lt;p&gt;Now, we will create the following table in the&amp;nbsp;&lt;strong&gt;TUTORIALS&lt;/strong&gt;&amp;nbsp;database.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;create table tutorials_tbl&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   tutorial_id INT NOT NULL AUTO_INCREMENT&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   tutorial_title VARCHAR&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; NOT NULL&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   tutorial_author VARCHAR&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;40&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; NOT NULL&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   submission_date DATE&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   PRIMARY KEY &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; tutorial_id &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Here, a few items need explanation &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;Field Attribute&amp;nbsp;&lt;strong&gt;NOT NULL&lt;/strong&gt;&amp;nbsp;is being used because we do not want this field to be NULL. So, if a user will try to create a record with a NULL value, then MySQL will raise an error.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Field Attribute&amp;nbsp;&lt;strong&gt;AUTO_INCREMENT&lt;/strong&gt;&amp;nbsp;tells MySQL to go ahead and add the next available number to the id field.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Keyword&amp;nbsp;&lt;strong&gt;PRIMARY KEY&lt;/strong&gt;&amp;nbsp;is used to define a column as a primary key. You can use multiple columns separated by a comma to define a primary key.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Creating Tables from Command Prompt&lt;/h2&gt;
&lt;p&gt;It is easy to create a MySQL table from the mysql&amp;gt; prompt. You will use the SQL command&amp;nbsp;&lt;strong&gt;CREATE TABLE&lt;/strong&gt;&amp;nbsp;to create a table.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Here is an example, which will create&amp;nbsp;&lt;strong&gt;tutorials_tbl&lt;/strong&gt;&amp;nbsp;&amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;root@host&lt;/span&gt;&lt;span class=&quot;com&quot;&gt;# mysql -u root -p&lt;/span&gt;
&lt;span class=&quot;typ&quot;&gt;Enter&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; password&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:*******&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
mysql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; TUTORIALS&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;typ&quot;&gt;Database&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; changed
mysql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; CREATE TABLE tutorials_tbl&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; tutorial_id INT NOT NULL AUTO_INCREMENT&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; tutorial_title VARCHAR&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; NOT NULL&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; tutorial_author VARCHAR&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;40&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; NOT NULL&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; submission_date DATE&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; PRIMARY KEY &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; tutorial_id &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;typ&quot;&gt;Query&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; OK&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; rows affected &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0.16&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; sec&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
mysql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;&amp;nbsp;&amp;minus; MySQL does not terminate a command until you give a semicolon (;) at the end of SQL command.&lt;/p&gt;
&lt;h2&gt;Creating Tables Using PHP Script&lt;/h2&gt;
&lt;p&gt;To create new table in any existing database you would need to use PHP function&amp;nbsp;&lt;strong&gt;mysql_query()&lt;/strong&gt;. You will pass its second argument with a proper SQL command to create a table.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;The following program is an example to create a table using PHP script &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Creating MySQL Tables&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;php
         $dbhost &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;localhost:3036&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $dbuser &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;root&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $dbpass &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;rootpassword&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_connect&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$dbhost&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $dbuser&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $dbpass&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         
         &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;die&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Could not connect: &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         echo &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Connected successfully&amp;lt;br /&amp;gt;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $sql &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;CREATE TABLE tutorials_tbl( &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;
            &lt;span class=&quot;str&quot;&gt;&quot;tutorial_id INT NOT NULL AUTO_INCREMENT, &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;
            &lt;span class=&quot;str&quot;&gt;&quot;tutorial_title VARCHAR(100) NOT NULL, &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;
            &lt;span class=&quot;str&quot;&gt;&quot;tutorial_author VARCHAR(40) NOT NULL, &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;
            &lt;span class=&quot;str&quot;&gt;&quot;submission_date DATE, &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;
            &lt;span class=&quot;str&quot;&gt;&quot;PRIMARY KEY ( tutorial_id )); &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         mysql_select_db&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;TUTORIALS&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $retval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_query&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $sql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         
         &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $retval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;die&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Could not create table: &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         echo &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Table created successfully\n&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         mysql_close&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$conn&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;?&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;h1&gt;Drop Table&lt;/h1&gt;
&lt;p&gt;It is very easy to drop an existing MySQL table, but you need to be very careful while deleting any existing table because the data lost will not be recovered after deleting a table.&lt;/p&gt;
&lt;h3&gt;Syntax&lt;/h3&gt;
&lt;p&gt;Here is a generic SQL syntax to drop a MySQL table &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;DROP TABLE table_name ;
&lt;/pre&gt;
&lt;h2&gt;Dropping Tables from the Command Prompt&lt;/h2&gt;
&lt;p&gt;To drop tables from the command prompt, we need to execute the DROP TABLE SQL command at the mysql&amp;gt; prompt.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;The following program is an example which deletes the&amp;nbsp;&lt;strong&gt;tutorials_tbl&lt;/strong&gt;&amp;nbsp;&amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;root@host# mysql -u root -p
Enter password:*******
mysql&amp;gt; use TUTORIALS;
Database changed
mysql&amp;gt; DROP TABLE tutorials_tbl
Query OK, 0 rows affected (0.8 sec)
mysql&amp;gt;
&lt;/pre&gt;
&lt;h2&gt;Dropping Tables Using PHP Script&lt;/h2&gt;
&lt;p&gt;To drop an existing table in any database, you would need to use the PHP function&amp;nbsp;&lt;strong&gt;mysql_query()&lt;/strong&gt;. You will pass its second argument with a proper SQL command to drop a table.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Creating MySQL Tables&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;php
         $dbhost &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;localhost:3036&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $dbuser &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;root&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $dbpass &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;rootpassword&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_connect&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$dbhost&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $dbuser&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $dbpass&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         
         &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;die&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Could not connect: &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         echo &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Connected successfully&amp;lt;br /&amp;gt;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $sql &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;DROP TABLE tutorials_tbl&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         mysql_select_db&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;TUTORIALS&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         $retval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_query&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $sql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         
         &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $retval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;die&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Could not delete table: &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         echo &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Table deleted successfully\n&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         mysql_close&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$conn&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;?&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;h1&gt;Insert&lt;/h1&gt;
&lt;p&gt;To insert data into a MySQL table, you would need to use the SQL&amp;nbsp;&lt;strong&gt;INSERT INTO&lt;/strong&gt;command. You can insert data into the MySQL table by using the mysql&amp;gt; prompt or by using any script like PHP.&lt;/p&gt;
&lt;h3&gt;Syntax&lt;/h3&gt;
&lt;p&gt;Here is a generic SQL syntax of INSERT INTO command to insert data into the MySQL table &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;INSERT INTO table_name ( field1, field2,...fieldN )
   VALUES
   ( value1, value2,...valueN );
&lt;/pre&gt;
&lt;p&gt;To insert string data types, it is required to keep all the values into double or single quotes. For example&amp;nbsp;&lt;strong&gt;&quot;value&quot;&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;Inserting Data from the Command Prompt&lt;/h2&gt;
&lt;p&gt;To insert data from the command prompt, we will use SQL INSERT INTO command to insert data into MySQL table tutorials_tbl.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;The following example will create 3 records into&amp;nbsp;&lt;strong&gt;tutorials_tbl&lt;/strong&gt;&amp;nbsp;table &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;root@host&lt;/span&gt;&lt;span class=&quot;com&quot;&gt;# mysql -u root -p password;&lt;/span&gt;
&lt;span class=&quot;typ&quot;&gt;Enter&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; password&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:*******&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
mysql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; TUTORIALS&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;typ&quot;&gt;Database&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; changed

mysql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; INSERT INTO tutorials_tbl 
   &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&amp;gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;tutorial_title&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; tutorial_author&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; submission_date&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VALUES
   &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&amp;gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Learn PHP&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;John Poul&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; NOW&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
&lt;span class=&quot;typ&quot;&gt;Query&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; OK&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; row affected &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0.01&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; sec&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

mysql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; INSERT INTO tutorials_tbl
   &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&amp;gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;tutorial_title&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; tutorial_author&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; submission_date&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VALUES
   &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&amp;gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Learn MySQL&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Abdul S&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; NOW&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
&lt;span class=&quot;typ&quot;&gt;Query&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; OK&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; row affected &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0.01&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; sec&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

mysql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; INSERT INTO tutorials_tbl
   &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&amp;gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;tutorial_title&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; tutorial_author&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; submission_date&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;VALUES
   &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&amp;gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;JAVA Tutorial&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Sanjay&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;2007-05-06&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;typ&quot;&gt;Query&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; OK&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; row affected &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0.01&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; sec&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
mysql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;&amp;nbsp;&amp;minus; Please note that all the arrow signs (-&amp;gt;) are not a part of the SQL command. They are indicating a new line and they are created automatically by the MySQL prompt while pressing the enter key without giving a semicolon at the end of each line of the command.&lt;/p&gt;
&lt;p&gt;In the above example, we have not provided a tutorial_id because at the time of table creation, we had given AUTO_INCREMENT option for this field. So MySQL takes care of inserting these IDs automatically. Here,&amp;nbsp;&lt;strong&gt;NOW()&lt;/strong&gt;&amp;nbsp;is a MySQL function, which returns the current date and time.&lt;/p&gt;
&lt;h2&gt;Inserting Data Using a PHP Script&lt;/h2&gt;
&lt;p&gt;You can use the same SQL INSERT INTO command into the PHP function&amp;nbsp;&lt;strong&gt;mysql_query()&lt;/strong&gt;&amp;nbsp;to insert data into a MySQL table.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;This example will take three parameters from the user and will insert them into the MySQL table &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Add New Record in MySQL Database&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;php
         &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;isset&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$_POST&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;add&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]))&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            $dbhost &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;localhost:3036&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            $dbuser &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;root&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            $dbpass &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;rootpassword&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_connect&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$dbhost&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $dbuser&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $dbpass&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         
            &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;die&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Could not connect: &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;

            &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; get_magic_quotes_gpc&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               $tutorial_title &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; addslashes &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$_POST&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;tutorial_title&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               $tutorial_author &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; addslashes &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$_POST&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;tutorial_author&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               $tutorial_title &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $_POST&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;tutorial_title&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;];&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               $tutorial_author &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $_POST&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;tutorial_author&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;];&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

            $submission_date &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $_POST&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;submission_date&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;];&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   
            $sql &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;INSERT INTO tutorials_tbl &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;
               &lt;span class=&quot;str&quot;&gt;&quot;(tutorial_title,tutorial_author, submission_date) &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;VALUES &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;
               &lt;span class=&quot;str&quot;&gt;&quot;(&#39;$tutorial_title&#39;,&#39;$tutorial_author&#39;,&#39;$submission_date&#39;)&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               mysql_select_db&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;TUTORIALS&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            $retval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_query&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $sql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         
            &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $retval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;die&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Could not enter data: &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            echo &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Entered data successfully\n&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            mysql_close&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$conn&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   
      &amp;lt;form method = &quot;post&quot; action = &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;php $_PHP_SELF &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&quot;&amp;gt;
         &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;table&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;600&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;border&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;0&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;cellspacing&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;1&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;cellpadding&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;2&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;250&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Tutorial Title&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;
                  &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;tutorial_title&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;tutorial_title&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
         
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;250&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Tutorial Author&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;
                  &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;tutorial_author&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;tutorial_author&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
         
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;250&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Submission Date [   yyyy-mm-dd ]&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;
                  &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;submission_date&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;submission_date&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
      
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;250&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
         
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;250&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;
                  &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;add&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;submit&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;add&quot;&lt;/span&gt;  &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Add Tutorial&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;php
      &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;?&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;While doing a data insert, it is best to use the function&amp;nbsp;&lt;strong&gt;get_magic_quotes_gpc()&lt;/strong&gt;&amp;nbsp;to check if the current configuration for magic quote is set or not. If this function returns false, then use the function&amp;nbsp;&lt;strong&gt;addslashes()&lt;/strong&gt;&amp;nbsp;to add slashes before the quotes.&lt;/p&gt;
&lt;p&gt;You can put many validations around to check if the entered data is correct or not and can take the appropriate action.&lt;/p&gt;

&lt;h1&gt;Select&lt;/h1&gt;
&lt;p&gt;The SQL&amp;nbsp;&lt;strong&gt;SELECT&lt;/strong&gt;&amp;nbsp;command is used to fetch data from the MySQL database. You can use this command at mysql&amp;gt; prompt as well as in any script like PHP.&lt;/p&gt;
&lt;h3&gt;Syntax&lt;/h3&gt;
&lt;p&gt;Here is generic SQL syntax of SELECT command to fetch data from the MySQL table &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;SELECT field1, field2,...fieldN 
FROM table_name1, table_name2...
[WHERE Clause]
[OFFSET M ][LIMIT N]
&lt;/pre&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;You can use one or more tables separated by comma to include various conditions using a WHERE clause, but the WHERE clause is an optional part of the SELECT command.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You can fetch one or more fields in a single SELECT command.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You can specify star (*) in place of fields. In this case, SELECT will return all the fields.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You can specify any condition using the WHERE clause.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You can specify an offset using&amp;nbsp;&lt;strong&gt;OFFSET&lt;/strong&gt;&amp;nbsp;from where SELECT will start returning records. By default, the offset starts at zero.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You can limit the number of returns using the&amp;nbsp;&lt;strong&gt;LIMIT&lt;/strong&gt;&amp;nbsp;attribute.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Fetching Data from a Command Prompt&lt;/h2&gt;
&lt;p&gt;This will use SQL SELECT command to fetch data from the MySQL table&amp;nbsp;&lt;strong&gt;tutorials_tbl&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;The following example will return all the records from the&amp;nbsp;&lt;strong&gt;tutorials_tbl&lt;/strong&gt;&amp;nbsp;table &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;root@host&lt;/span&gt;&lt;span class=&quot;com&quot;&gt;# mysql -u root -p password;&lt;/span&gt;
&lt;span class=&quot;typ&quot;&gt;Enter&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; password&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:*******&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
mysql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; TUTORIALS&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;typ&quot;&gt;Database&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; changed
mysql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; SELECT &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; tutorials_tbl 
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+-------------+----------------+-----------------+-----------------+&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; tutorial_id &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; tutorial_title &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; tutorial_author &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; submission_date &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;|&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;+-------------+----------------+-----------------+-----------------+&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;|&lt;/span&gt;           &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Learn&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; PHP      &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;John&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Poul&lt;/span&gt;       &lt;span class=&quot;pun&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;2007&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;05&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;21&lt;/span&gt;      &lt;span class=&quot;pun&quot;&gt;|&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;|&lt;/span&gt;           &lt;span class=&quot;lit&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Learn&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;MySQL&lt;/span&gt;    &lt;span class=&quot;pun&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Abdul&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; S         &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;2007&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;05&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;21&lt;/span&gt;      &lt;span class=&quot;pun&quot;&gt;|&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;|&lt;/span&gt;           &lt;span class=&quot;lit&quot;&gt;3&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; JAVA &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Tutorial&lt;/span&gt;  &lt;span class=&quot;pun&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Sanjay&lt;/span&gt;          &lt;span class=&quot;pun&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;2007&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;05&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;21&lt;/span&gt;      &lt;span class=&quot;pun&quot;&gt;|&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;+-------------+----------------+-----------------+-----------------+&lt;/span&gt;
&lt;span class=&quot;lit&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; rows &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0.01&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; sec&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

mysql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;Fetching Data Using a PHP Script&lt;/h2&gt;
&lt;p&gt;You can use the same SQL SELECT command into a PHP function&amp;nbsp;&lt;strong&gt;mysql_query()&lt;/strong&gt;. This function is used to execute the SQL command and then later another PHP function&amp;nbsp;&lt;strong&gt;mysql_fetch_array()&lt;/strong&gt;&amp;nbsp;can be used to fetch all the selected data. This function returns the row as an associative array, a numeric array, or both. This function returns FALSE if there are no more rows.&lt;/p&gt;
&lt;p&gt;The following program is a simple example which will show how to fetch / display records from the&amp;nbsp;&lt;strong&gt;tutorials_tbl&lt;/strong&gt;&amp;nbsp;table.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;The following code block will display all the records from the tutorials_tbl table.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;php
   $dbhost &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;localhost:3036&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $dbuser &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;root&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $dbpass &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;rootpassword&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_connect&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$dbhost&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $dbuser&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $dbpass&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
   
   &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;die&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Could not connect: &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $sql &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;SELECT tutorial_id, tutorial_title, tutorial_author, submission_date FROM tutorials_tbl&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

   mysql_select_db&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;TUTORIALS&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $retval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_query&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $sql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
   
   &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $retval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;die&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Could not get data: &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
   
   &lt;span class=&quot;kwd&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$row &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_fetch_array&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$retval&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; MYSQL_ASSOC&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      echo &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Tutorial ID :{$row[&#39;tutorial_id&#39;]}  &amp;lt;br&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;
         &lt;span class=&quot;str&quot;&gt;&quot;Title: {$row[&#39;tutorial_title&#39;]} &amp;lt;br&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;
         &lt;span class=&quot;str&quot;&gt;&quot;Author: {$row[&#39;tutorial_author&#39;]} &amp;lt;br&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;
         &lt;span class=&quot;str&quot;&gt;&quot;Submission Date : {$row[&#39;submission_date&#39;]} &amp;lt;br&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;
         &lt;span class=&quot;str&quot;&gt;&quot;--------------------------------&amp;lt;br&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
   echo &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Fetched data successfully\n&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   mysql_close&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$conn&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The content of the rows is assigned to the variable $row and the values in that row are then printed.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;&amp;nbsp;&amp;minus; Always remember to put curly brackets when you want to insert an array value directly into a string.&lt;/p&gt;
&lt;p&gt;In the above example, the constant&amp;nbsp;&lt;strong&gt;MYSQL_ASSOC&lt;/strong&gt;&amp;nbsp;is used as the second argument to the PHP function&amp;nbsp;&lt;strong&gt;mysql_fetch_array()&lt;/strong&gt;, so that it returns the row as an associative array. With an associative array you can access the field by using their name instead of using the index.&lt;/p&gt;
&lt;p&gt;PHP provides another function called&amp;nbsp;&lt;strong&gt;mysql_fetch_assoc()&lt;/strong&gt;, which also returns the row as an associative array.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;The following example to display all the records from the tutorial_tbl table using mysql_fetch_assoc() function.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;php
   $dbhost &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;localhost:3036&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $dbuser &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;root&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $dbpass &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;rootpassword&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_connect&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$dbhost&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $dbuser&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $dbpass&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
   
   &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;die&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Could not connect: &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   
   $sql &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;SELECT tutorial_id, tutorial_title, tutorial_author, submission_date
      FROM tutorials_tbl&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

   mysql_select_db&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;TUTORIALS&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $retval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_query&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $sql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
   
   &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $retval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;die&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Could not get data: &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
   
   &lt;span class=&quot;kwd&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$row &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_fetch_assoc&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$retval&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      echo &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Tutorial ID :{$row[&#39;tutorial_id&#39;]}  &amp;lt;br&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;
         &lt;span class=&quot;str&quot;&gt;&quot;Title: {$row[&#39;tutorial_title&#39;]} &amp;lt;br&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;
         &lt;span class=&quot;str&quot;&gt;&quot;Author: {$row[&#39;tutorial_author&#39;]} &amp;lt;br&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;
         &lt;span class=&quot;str&quot;&gt;&quot;Submission Date : {$row[&#39;submission_date&#39;]} &amp;lt;br&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;
         &lt;span class=&quot;str&quot;&gt;&quot;--------------------------------&amp;lt;br&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
   echo &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Fetched data successfully\n&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   mysql_close&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$conn&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;You can also use the constant&amp;nbsp;&lt;strong&gt;MYSQL_NUM&lt;/strong&gt;&amp;nbsp;as the second argument to the PHP function mysql_fetch_array(). This will cause the function to return an array with the numeric index.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Try out the following example to display all the records from tutorials_tbl table using the MYSQL_NUM argument.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;php
   $dbhost &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;localhost:3036&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $dbuser &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;root&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $dbpass &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;rootpassword&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_connect&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$dbhost&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $dbuser&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $dbpass&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;

   &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;die&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Could not connect: &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   
   $sql &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;SELECT tutorial_id, tutorial_title, tutorial_author, submission_date
      FROM tutorials_tbl&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

   mysql_select_db&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;TUTORIALS&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $retval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_query&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $sql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
   
   &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $retval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;die&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Could not get data: &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
   
   &lt;span class=&quot;kwd&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$row &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_fetch_array&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$retval&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; MYSQL_NUM&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      echo &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Tutorial ID :{$row[0]}  &amp;lt;br&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;
         &lt;span class=&quot;str&quot;&gt;&quot;Title: {$row[1]} &amp;lt;br&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;
         &lt;span class=&quot;str&quot;&gt;&quot;Author: {$row[2]} &amp;lt;br&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;
         &lt;span class=&quot;str&quot;&gt;&quot;Submission Date : {$row[3]} &amp;lt;br&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;
         &lt;span class=&quot;str&quot;&gt;&quot;--------------------------------&amp;lt;br&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   echo &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Fetched data successfully\n&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   mysql_close&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$conn&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;All the above three examples will produce the same result.&lt;/p&gt;
&lt;h2&gt;Releasing Memory&lt;/h2&gt;
&lt;p&gt;It is a good practice to release cursor memory at the end of each SELECT statement. This can be done by using the PHP function&amp;nbsp;&lt;strong&gt;mysql_free_result()&lt;/strong&gt;. The following program is the example to show how it should be used.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Try out the following example &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;php
   $dbhost &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;localhost:3036&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $dbuser &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;root&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $dbpass &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;rootpassword&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_connect&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$dbhost&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $dbuser&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $dbpass&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;

   &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;die&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Could not connect: &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   
   $sql &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;SELECT tutorial_id, tutorial_title, tutorial_author, submission_date
      FROM tutorials_tbl&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

   mysql_select_db&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;TUTORIALS&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $retval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_query&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $sql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
   
   &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $retval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;die&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Could not get data: &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
   
   &lt;span class=&quot;kwd&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$row &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_fetch_array&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$retval&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; MYSQL_NUM&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      echo &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Tutorial ID :{$row[0]}  &amp;lt;br&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;
         &lt;span class=&quot;str&quot;&gt;&quot;Title: {$row[1]} &amp;lt;br&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;
         &lt;span class=&quot;str&quot;&gt;&quot;Author: {$row[2]} &amp;lt;br&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;
         &lt;span class=&quot;str&quot;&gt;&quot;Submission Date : {$row[3]} &amp;lt;br&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;
         &lt;span class=&quot;str&quot;&gt;&quot;--------------------------------&amp;lt;br&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   mysql_free_result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$retval&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   echo &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Fetched data successfully\n&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   mysql_close&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$conn&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;While fetching data, you can write as complex a code as you like, but the procedure will remain the same as mentioned above.&lt;/p&gt;

&lt;h1&gt;Update&lt;/h1&gt;
&lt;p&gt;There may be a requirement where the existing data in a MySQL table needs to be modified. You can do so by using the SQL&amp;nbsp;&lt;strong&gt;UPDATE&lt;/strong&gt;&amp;nbsp;command. This will modify any field value of any MySQL table.&lt;/p&gt;
&lt;h3&gt;Syntax&lt;/h3&gt;
&lt;p&gt;The following code block has a generic SQL syntax of the UPDATE command to modify the data in the MySQL table &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;UPDATE table_name SET field1 = new-value1, field2 = new-value2
[WHERE Clause]
&lt;/pre&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;You can update one or more field altogether.&lt;/li&gt;
&lt;li&gt;You can specify any condition using the WHERE clause.&lt;/li&gt;
&lt;li&gt;You can update the values in a single table at a time.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The WHERE clause is very useful when you want to update the selected rows in a table.&lt;/p&gt;
&lt;h2&gt;Updating Data from the Command Prompt&lt;/h2&gt;
&lt;p&gt;This will use the SQL UPDATE command with the WHERE clause to update the selected data in the MySQL table&amp;nbsp;&lt;strong&gt;tutorials_tbl&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;The following example will update the&amp;nbsp;&lt;strong&gt;tutorial_title&lt;/strong&gt;&amp;nbsp;field for a record having the tutorial_id as 3.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;root@host&lt;/span&gt;&lt;span class=&quot;com&quot;&gt;# mysql -u root -p password;&lt;/span&gt;
&lt;span class=&quot;typ&quot;&gt;Enter&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; password&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:*******&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

mysql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; TUTORIALS&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;typ&quot;&gt;Database&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; changed

mysql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; UPDATE tutorials_tbl 
   &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; SET tutorial_title &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Learning JAVA&#39;&lt;/span&gt; 
   &lt;span class=&quot;pun&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; WHERE tutorial_id &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;typ&quot;&gt;Query&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; OK&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; row affected &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0.04&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; sec&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;typ&quot;&gt;Rows&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; matched&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;  &lt;span class=&quot;typ&quot;&gt;Changed&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;  &lt;span class=&quot;typ&quot;&gt;Warnings&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

mysql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;Updating Data Using a PHP Script&lt;/h2&gt;
&lt;p&gt;You can use the SQL UPDATE command with or without the WHERE CLAUSE into the PHP function &amp;ndash;&amp;nbsp;&lt;strong&gt;mysql_query()&lt;/strong&gt;. This function will execute the SQL command in a similar way it is executed at the mysql&amp;gt; prompt.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;The following example to update the&amp;nbsp;&lt;strong&gt;tutorial_title&lt;/strong&gt;&amp;nbsp;field for a record having tutorial_id as 3.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;php
   $dbhost &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;localhost:3036&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $dbuser &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;root&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $dbpass &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;rootpassword&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_connect&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$dbhost&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $dbuser&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $dbpass&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
   
   &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;die&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Could not connect: &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

   $sql &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;UPDATE tutorials_tbl
      SET tutorial_title=&quot;Learning JAVA&quot;
      WHERE tutorial_id=3&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

   mysql_select_db&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;TUTORIALS&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $retval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_query&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $sql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
   
   &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $retval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;die&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Could not update data: &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   echo &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Updated data successfully\n&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   mysql_&lt;/span&gt;&lt;/pre&gt;

&lt;h1&gt;Delete&lt;/h1&gt;
&lt;p&gt;If you want to delete a record from any MySQL table, then you can use the SQL command&amp;nbsp;&lt;strong&gt;DELETE FROM&lt;/strong&gt;. You can use this command at the mysql&amp;gt; prompt as well as in any script like PHP.&lt;/p&gt;
&lt;h3&gt;Syntax&lt;/h3&gt;
&lt;p&gt;The following code block has a generic SQL syntax of the DELETE command to delete data from a MySQL table.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;DELETE FROM table_name [WHERE Clause]
&lt;/pre&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;If the WHERE clause is not specified, then all the records will be deleted from the given MySQL table.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You can specify any condition using the WHERE clause.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You can delete records in a single table at a time.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The WHERE clause is very useful when you want to delete selected rows in a table.&lt;/p&gt;
&lt;h2&gt;Deleting Data from the Command Prompt&lt;/h2&gt;
&lt;p&gt;This will use the SQL DELETE command with the WHERE clause to delete selected data into the MySQL table &amp;ndash;&amp;nbsp;&lt;strong&gt;tutorials_tbl&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;The following example will delete a record from the tutorial_tbl whose tutorial_id is 3.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;root@host&lt;/span&gt;&lt;span class=&quot;com&quot;&gt;# mysql -u root -p password;&lt;/span&gt;
&lt;span class=&quot;typ&quot;&gt;Enter&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; password&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:*******&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

mysql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;use&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; TUTORIALS&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;typ&quot;&gt;Database&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; changed

mysql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; DELETE FROM tutorials_tbl WHERE tutorial_id&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;typ&quot;&gt;Query&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; OK&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; row affected &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0.23&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; sec&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

mysql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;Deleting Data Using a PHP Script&lt;/h2&gt;
&lt;p&gt;You can use the SQL DELETE command with or without the WHERE CLAUSE into the PHP function &amp;ndash;&amp;nbsp;&lt;strong&gt;mysql_query()&lt;/strong&gt;. This function will execute the SQL command in the same way as it is executed at the mysql&amp;gt; prompt.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Try the following example to delete a record from the tutorial_tbl whose tutorial_id is 3.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;php
   $dbhost &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;localhost:3036&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $dbuser &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;root&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $dbpass &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;rootpassword&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_connect&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$dbhost&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $dbuser&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $dbpass&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
   
   &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;die&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Could not connect: &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

   $sql &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;DELETE FROM tutorials_tbl WHERE tutorial_id = 3&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

   mysql_select_db&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;TUTORIALS&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $retval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_query&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $sql&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $conn &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;

   &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $retval &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;die&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Could not delete data: &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   echo &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Deleted data successfully\n&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   mysql_close&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$conn&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;hr /&gt;
&lt;div class=&quot;pre-btn&quot;&gt;&lt;a href=&quot;https://www.tutorialspoint.com/mysql/mysql-update-query.htm&quot;&gt;&amp;nbsp;Previous Page&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;print-btn center&quot;&gt;&lt;a href=&quot;https://www.tutorialspoint.com/cgi-bin/printpage.cgi&quot; target=&quot;_blank&quot;&gt;&amp;nbsp;Print&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;nxt-btn&quot;&gt;&lt;a href=&quot;https://www.tutorialspoint.com/mysql/mysql-like-clause.htm&quot;&gt;Next Page&amp;nbsp;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;

&lt;h1&gt;SQL Injection&lt;/h1&gt;
&lt;p&gt;If you take user input through a webpage and insert it into a MySQL database, there&#39;s a chance that you have left yourself wide open for a security issue known as&amp;nbsp;&lt;strong&gt;SQL Injection&lt;/strong&gt;. This chapter will teach you how to help prevent this from happening and help you secure your scripts and MySQL statements.&lt;/p&gt;
&lt;p&gt;The SQL Injection usually occurs when you ask a user for input, like their name and instead of a name they give you a MySQL statement that you will unknowingly run on your database.&lt;/p&gt;
&lt;p&gt;Never trust the data provided by a user, process this data only after validation; as a rule, this is done by pattern matching. In the following example, the username is restricted to alphanumerical characters plus underscore and to a length between 8 and 20 characters &amp;ndash; modify these rules as needed.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;preg_match&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;/^\w{8,20}$/&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $_GET&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;username&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $matches&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_query&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;SELECT * FROM users WHERE username = $matches[0]&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;else&lt;/span&gt;  &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   echo &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;username not accepted&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;To demonstrate this problem, consider the following excerpt.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;com&quot;&gt;// supposed input&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
$name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Qadir&#39;; DELETE FROM users;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
mysql_query&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;SELECT * FROM users WHERE name = &#39;{$name}&#39;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The function call is supposed to retrieve a record from the users table, where the name column matches the name specified by the user. Under normal circumstances, $name would only contain alphanumeric characters and perhaps spaces. But here, by appending an entirely new query to&amp;nbsp;&lt;strong&gt;$name&lt;/strong&gt;, the call to the database turns into a disaster. The injected DELETE query removes all the records from users.&lt;/p&gt;
&lt;p&gt;Fortunately, if you use MySQL, the&amp;nbsp;&lt;strong&gt;mysql_query()&lt;/strong&gt;&amp;nbsp;function does not permit query stacking or executing multiple queries in a single function call. If you try to stack queries, the call fails.&lt;/p&gt;
&lt;p&gt;However, other PHP database extensions, such as&amp;nbsp;&lt;strong&gt;SQLite&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;PostgreSQL&lt;/strong&gt;, happily perform stacked queries, executing all the queries provided in one string and creating a serious security problem.&lt;/p&gt;
&lt;h2&gt;Preventing SQL Injection&lt;/h2&gt;
&lt;p&gt;You can handle all escape characters smartly in scripting languages like PERL and PHP. The MySQL extension for PHP provides the function&amp;nbsp;&lt;strong&gt;mysql_real_escape_string()&lt;/strong&gt;&amp;nbsp;to escape input characters that are special to MySQL.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;get_magic_quotes_gpc&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;())&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; stripslashes&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

$name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_real_escape_string&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
mysql_query&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;SELECT * FROM users WHERE name = &#39;{$name}&#39;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;The LIKE Quandary&lt;/h2&gt;
&lt;p&gt;To address the LIKE quandary, a custom escaping mechanism must convert user-supplied % and _ characters to literals. Use&amp;nbsp;&lt;strong&gt;addcslashes()&lt;/strong&gt;, a function that lets you specify a character range to escape.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;$sub &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; addcslashes&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;mysql_real_escape_string&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;%something_&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;%_&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;com&quot;&gt;// $sub == \%something\_&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
mysql_query&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;SELECT * FROM messages WHERE subject LIKE &#39;{$sub}%&#39;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;

&lt;h1&gt;Database Information&lt;/h1&gt;
&lt;h2&gt;Obtaining and Using MySQL Metadata&lt;/h2&gt;
&lt;p&gt;There are three types of information, which you would like to have from MySQL.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Information about the result of queries&lt;/strong&gt;&amp;nbsp;&amp;minus; This includes the number of records affected by any SELECT, UPDATE or DELETE statement.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Information about the tables and databases&lt;/strong&gt;&amp;nbsp;&amp;minus; This includes information pertaining to the structure of the tables and the databases.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Information about the MySQL server&lt;/strong&gt;&amp;nbsp;&amp;minus; This includes the status of the database server, version number, etc.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It is very easy to get all this information at the MySQL prompt, but while using PERL or PHP APIs, we need to call various APIs explicitly to obtain all this information.&lt;/p&gt;
&lt;h2&gt;Obtaining the Number of Rows Affected by a Query&lt;/h2&gt;
&lt;p&gt;Let is now see how to obtain this information.&lt;/p&gt;
&lt;h3&gt;PERL Example&lt;/h3&gt;
&lt;p&gt;In DBI scripts, the affected row count is returned by the&amp;nbsp;&lt;strong&gt;do( )&lt;/strong&gt;&amp;nbsp;or by the&amp;nbsp;&lt;strong&gt;execute( )&lt;/strong&gt;command, depending on how you execute the query.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;com&quot;&gt;# Method 1&lt;/span&gt;
&lt;span class=&quot;com&quot;&gt;# execute $query using do( )&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;my&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $count &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $dbh&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$query&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;com&quot;&gt;# report 0 rows if an error occurred&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
printf &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;%d rows were affected\n&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;defined&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$count&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $count &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;com&quot;&gt;# Method 2&lt;/span&gt;
&lt;span class=&quot;com&quot;&gt;# execute query using prepare( ) plus execute( )&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;my&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $sth &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $dbh&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;prepare &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$query&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;my&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $count &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $sth&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;execute &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
printf &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;%d rows were affected\n&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;defined&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$count&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $count &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;PHP Example&lt;/h3&gt;
&lt;p&gt;In PHP, invoke the&amp;nbsp;&lt;strong&gt;mysql_affected_rows( )&lt;/strong&gt;&amp;nbsp;function to find out how many rows a query changed.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;$result_id &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_query &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$query&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $conn_id&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;com&quot;&gt;# report 0 rows if the query failed&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
$count &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$result_id &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_affected_rows &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$conn_id&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;$count rows were affected\n&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;Listing Tables and Databases&lt;/h2&gt;
&lt;p&gt;It is very easy to list down all the databases and the tables available with a database server. Your result may be&amp;nbsp;&lt;strong&gt;null&lt;/strong&gt;&amp;nbsp;if you don&#39;t have the sufficient privileges.&lt;/p&gt;
&lt;p&gt;Apart from the method which is shown in the following code block, you can use&amp;nbsp;&lt;strong&gt;SHOW TABLES&lt;/strong&gt;&amp;nbsp;or&amp;nbsp;&lt;strong&gt;SHOW DATABASES&lt;/strong&gt;&amp;nbsp;queries to get the list of tables or databases either in PHP or in PERL.&lt;/p&gt;
&lt;h3&gt;PERL Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;com&quot;&gt;# Get all the tables available in current database.&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;@tables&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $dbh&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;tables &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;foreach&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $table &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;@tables&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;){&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Table Name $table\n&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;PHP Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;php
   $con &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_connect&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;localhost&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;userid&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;password&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
   
   &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$con&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;die&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Could not connect: &#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $db_list &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_list_dbs&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$con&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;

   &lt;span class=&quot;kwd&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$db &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mysql_fetch_object&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$db_list&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      echo $db&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Database&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   mysql_close&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$con&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;Getting Server Metadata&lt;/h2&gt;
&lt;p&gt;There are a few important commands in MySQL which can be executed either at the MySQL prompt or by using any script like PHP to get various important information about the database server.&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Sr.No.&lt;/th&gt;
&lt;th&gt;Command &amp;amp; Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;1&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;SELECT VERSION( )&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Server version string&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;2&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;SELECT DATABASE( )&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Current database name (empty if none)&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;3&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;SELECT USER( )&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Current username&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;4&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;SHOW STATUS&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Server status indicators&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;5&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;SHOW VARIABLES&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Server configuration variables&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;script&gt;mbtTOC();&lt;/script&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;http://feeds.feedburner.com/PostLinkSharing&lt;/div&gt;</description><link>https://plinksharing.blogspot.com/2021/02/mysql-tutorials.html</link><author>noreply@blogger.com (Arakkha Sênâ)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1955839799848409424.post-7058161514137703545</guid><pubDate>Tue, 16 Feb 2021 10:52:00 +0000</pubDate><atom:updated>2021-02-16T02:52:16.417-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Css &amp; Jav</category><category domain="http://www.blogger.com/atom/ns#">Web Programs</category><title>JavaScript Tutorials </title><description>&lt;div class=&quot;mbtTOC&quot;&gt;
    &lt;button onclick=&quot;mbtToggle()&quot;&gt;Contents&lt;/button&gt;
    &lt;ol id=&quot;mbtTOC&quot;&gt;&lt;/ol&gt;
    &lt;/div&gt;
&lt;h1&gt;Introduction&lt;/h1&gt;
&lt;h2&gt;What is JavaScript ?&lt;/h2&gt;
&lt;p&gt;JavaScript is a dynamic computer programming language. It is lightweight and most commonly used as a part of web pages, whose implementations allow client-side script to interact with the user and make dynamic pages. It is an interpreted programming language with object-oriented capabilities.&lt;/p&gt;
&lt;p&gt;JavaScript was first known as&amp;nbsp;&lt;strong&gt;LiveScript,&lt;/strong&gt;&amp;nbsp;but Netscape changed its name to JavaScript, possibly because of the excitement being generated by Java. JavaScript made its first appearance in Netscape 2.0 in 1995 with the name&amp;nbsp;&lt;strong&gt;LiveScript&lt;/strong&gt;. The general-purpose core of the language has been embedded in Netscape, Internet Explorer, and other web browsers.&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;&lt;a href=&quot;http://www.ecma-international.org/publications/index.html&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;ECMA-262 Specification&lt;/a&gt;&amp;nbsp;defined a standard version of the core JavaScript language.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;JavaScript is a lightweight, interpreted programming language.&lt;/li&gt;
&lt;li&gt;Designed for creating network-centric applications.&lt;/li&gt;
&lt;li&gt;Complementary to and integrated with Java.&lt;/li&gt;
&lt;li&gt;Complementary to and integrated with HTML.&lt;/li&gt;
&lt;li&gt;Open and cross-platform&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Client-Side JavaScript&lt;/h2&gt;
&lt;p&gt;Client-side JavaScript is the most common form of the language. The script should be included in or referenced by an HTML document for the code to be interpreted by the browser.&lt;/p&gt;
&lt;p&gt;It means that a web page need not be a static HTML, but can include programs that interact with the user, control the browser, and dynamically create HTML content.&lt;/p&gt;
&lt;p&gt;The JavaScript client-side mechanism provides many advantages over traditional CGI server-side scripts. For example, you might use JavaScript to check if the user has entered a valid e-mail address in a form field.&lt;/p&gt;
&lt;p&gt;The JavaScript code is executed when the user submits the form, and only if all the entries are valid, they would be submitted to the Web Server.&lt;/p&gt;
&lt;p&gt;JavaScript can be used to trap user-initiated events such as button clicks, link navigation, and other actions that the user initiates explicitly or implicitly.&lt;/p&gt;
&lt;h2&gt;Advantages of JavaScript&lt;/h2&gt;
&lt;p&gt;The merits of using JavaScript are &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Less server interaction&lt;/strong&gt;&amp;nbsp;&amp;minus; You can validate user input before sending the page off to the server. This saves server traffic, which means less load on your server.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Immediate feedback to the visitors&lt;/strong&gt;&amp;nbsp;&amp;minus; They don&#39;t have to wait for a page reload to see if they have forgotten to enter something.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Increased interactivity&lt;/strong&gt;&amp;nbsp;&amp;minus; You can create interfaces that react when the user hovers over them with a mouse or activates them via the keyboard.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Richer interfaces&lt;/strong&gt;&amp;nbsp;&amp;minus; You can use JavaScript to include such items as drag-and-drop components and sliders to give a Rich Interface to your site visitors.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Limitations of JavaScript&lt;/h2&gt;
&lt;p&gt;We cannot treat JavaScript as a full-fledged programming language. It lacks the following important features &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;Client-side JavaScript does not allow the reading or writing of files. This has been kept for security reason.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;JavaScript cannot be used for networking applications because there is no such support available.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;JavaScript doesn&#39;t have any multi-threading or multiprocessor capabilities.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Once again, JavaScript is a lightweight, interpreted programming language that allows you to build interactivity into otherwise static HTML pages.&lt;/p&gt;
&lt;h2&gt;JavaScript Development Tools&lt;/h2&gt;
&lt;p&gt;One of major strengths of JavaScript is that it does not require expensive development tools. You can start with a simple text editor such as Notepad. Since it is an interpreted language inside the context of a web browser, you don&#39;t even need to buy a compiler.&lt;/p&gt;
&lt;p&gt;To make our life simpler, various vendors have come up with very nice JavaScript editing tools. Some of them are listed here &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Microsoft FrontPage&lt;/strong&gt;&amp;nbsp;&amp;minus; Microsoft has developed a popular HTML editor called FrontPage. FrontPage also provides web developers with a number of JavaScript tools to assist in the creation of interactive websites.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Macromedia Dreamweaver MX&lt;/strong&gt;&amp;nbsp;&amp;minus; Macromedia Dreamweaver MX is a very popular HTML and JavaScript editor in the professional web development crowd. It provides several handy prebuilt JavaScript components, integrates well with databases, and conforms to new standards such as XHTML and XML.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Macromedia HomeSite 5&lt;/strong&gt;&amp;nbsp;&amp;minus; HomeSite 5 is a well-liked HTML and JavaScript editor from Macromedia that can be used to manage personal websites effectively.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Where is JavaScript Today ?&lt;/h2&gt;
&lt;p&gt;The ECMAScript Edition 5 standard will be the first update to be released in over four years. JavaScript 2.0 conforms to Edition 5 of the ECMAScript standard, and the difference between the two is extremely minor.&lt;/p&gt;
&lt;p&gt;The specification for JavaScript 2.0 can be found on the following site:&amp;nbsp;&lt;a href=&quot;http://www.ecmascript.org/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://www.ecmascript.org/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Today, Netscape&#39;s JavaScript and Microsoft&#39;s JScript conform to the ECMAScript standard, although both the languages still support the features that are not a part of the standard.&lt;/p&gt;

&lt;h1&gt;Syntax&lt;/h1&gt;
&lt;p&gt;JavaScript can be implemented using JavaScript statements that are placed within the&amp;nbsp;&lt;strong&gt;&amp;lt;script&amp;gt;... &amp;lt;/script&amp;gt;&lt;/strong&gt;&amp;nbsp;HTML tags in a web page.&lt;/p&gt;
&lt;p&gt;You can place the&amp;nbsp;&lt;strong&gt;&amp;lt;script&amp;gt;&lt;/strong&gt;&amp;nbsp;tags, containing your JavaScript, anywhere within your web page, but it is normally recommended that you should keep it within the&amp;nbsp;&lt;strong&gt;&amp;lt;head&amp;gt;&lt;/strong&gt;&amp;nbsp;tags.&lt;/p&gt;
&lt;p&gt;The &amp;lt;script&amp;gt; tag alerts the browser program to start interpreting all the text between these tags as a script. A simple syntax of your JavaScript will appear as follows.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&amp;lt;script ...&amp;gt;
   JavaScript code
&amp;lt;/script&amp;gt;
&lt;/pre&gt;
&lt;p&gt;The script tag takes two important attributes &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Language&lt;/strong&gt;&amp;nbsp;&amp;minus; This attribute specifies what scripting language you are using. Typically, its value will be javascript. Although recent versions of HTML (and XHTML, its successor) have phased out the use of this attribute.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Type&lt;/strong&gt;&amp;nbsp;&amp;minus; This attribute is what is now recommended to indicate the scripting language in use and its value should be set to &quot;text/javascript&quot;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So your JavaScript segment will look like &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&amp;lt;script language = &quot;javascript&quot; type = &quot;text/javascript&quot;&amp;gt;
   JavaScript code
&amp;lt;/script&amp;gt;
&lt;/pre&gt;
&lt;h2&gt;Your First JavaScript Code&lt;/h2&gt;
&lt;p&gt;Let us take a sample example to print out &quot;Hello World&quot;. We added an optional HTML comment that surrounds our JavaScript code. This is to save our code from a browser that does not support JavaScript. The comment ends with a &quot;//--&amp;gt;&quot;. Here &quot;//&quot; signifies a comment in JavaScript, so we add that to prevent a browser from reading the end of the HTML comment as a piece of JavaScript code. Next, we call a function&amp;nbsp;&lt;strong&gt;document.write&lt;/strong&gt;which writes a string into our HTML document.&lt;/p&gt;
&lt;p&gt;This function can be used to write text, HTML, or both. Take a look at the following code.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/aMKLYm&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;   
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;language&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Hello World!&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This code will produce the following result &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;Hello World!
&lt;/pre&gt;
&lt;h2&gt;Whitespace and Line Breaks&lt;/h2&gt;
&lt;p&gt;JavaScript ignores spaces, tabs, and newlines that appear in JavaScript programs. You can use spaces, tabs, and newlines freely in your program and you are free to format and indent your programs in a neat and consistent way that makes the code easy to read and understand.&lt;/p&gt;
&lt;h2&gt;Semicolons are Optional&lt;/h2&gt;
&lt;p&gt;Simple statements in JavaScript are generally followed by a semicolon character, just as they are in C, C++, and Java. JavaScript, however, allows you to omit this semicolon if each of your statements are placed on a separate line. For example, the following code could be written without semicolons.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;language&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      var1 &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      var2 &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;20&lt;/span&gt;
   &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;But when formatted in a single line as follows, you must use semicolons &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;language&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      var1 &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; var2 &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&amp;nbsp;&amp;minus; It is a good programming practice to use semicolons.&lt;/p&gt;
&lt;h2&gt;Case Sensitivity&lt;/h2&gt;
&lt;p&gt;JavaScript is a case-sensitive language. This means that the language keywords, variables, function names, and any other identifiers must always be typed with a consistent capitalization of letters.&lt;/p&gt;
&lt;p&gt;So the identifiers&amp;nbsp;&lt;strong&gt;Time&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;TIME&lt;/strong&gt;&amp;nbsp;will convey different meanings in JavaScript.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;&amp;nbsp;&amp;minus; Care should be taken while writing variable and function names in JavaScript.&lt;/p&gt;
&lt;h2&gt;Comments in JavaScript&lt;/h2&gt;
&lt;p&gt;JavaScript supports both C-style and C++-style comments, Thus &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;Any text between a // and the end of a line is treated as a comment and is ignored by JavaScript.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Any text between the characters /* and */ is treated as a comment. This may span multiple lines.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;JavaScript also recognizes the HTML comment opening sequence &amp;lt;!--. JavaScript treats this as a single-line comment, just as it does the // comment.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The HTML comment closing sequence --&amp;gt; is not recognized by JavaScript so it should be written as //--&amp;gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;The following example shows how to use comments in JavaScript.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;language&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
      &lt;span class=&quot;com&quot;&gt;// This is a comment. It is similar to comments in C++&lt;/span&gt;
   
      &lt;span class=&quot;com&quot;&gt;/*
      * This is a multi-line comment in JavaScript
      * It is very similar to comments in C Programming
      */&lt;/span&gt;
   &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;h1&gt;Valiables&lt;/h1&gt;
&lt;h2&gt;JavaScript Datatypes&lt;/h2&gt;
&lt;p&gt;One of the most fundamental characteristics of a programming language is the set of data types it supports. These are the type of values that can be represented and manipulated in a programming language.&lt;/p&gt;
&lt;p&gt;JavaScript allows you to work with three primitive data types &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Numbers,&lt;/strong&gt;&amp;nbsp;eg. 123, 120.50 etc.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Strings&lt;/strong&gt;&amp;nbsp;of text e.g. &quot;This text string&quot; etc.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Boolean&lt;/strong&gt;&amp;nbsp;e.g. true or false.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;JavaScript also defines two trivial data types,&amp;nbsp;&lt;strong&gt;null&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;undefined,&lt;/strong&gt;&amp;nbsp;each of which defines only a single value. In addition to these primitive data types, JavaScript supports a composite data type known as&amp;nbsp;&lt;strong&gt;object&lt;/strong&gt;. We will cover objects in detail in a separate chapter.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&amp;nbsp;&amp;minus; JavaScript does not make a distinction between integer values and floating-point values. All numbers in JavaScript are represented as floating-point values. JavaScript represents numbers using the 64-bit floating-point format defined by the IEEE 754 standard.&lt;/p&gt;
&lt;h2&gt;JavaScript Variables&lt;/h2&gt;
&lt;p&gt;Like many other programming languages, JavaScript has variables. Variables can be thought of as named containers. You can place data into these containers and then refer to the data simply by naming the container.&lt;/p&gt;
&lt;p&gt;Before you use a variable in a JavaScript program, you must declare it. Variables are declared with the&amp;nbsp;&lt;strong&gt;var&lt;/strong&gt;&amp;nbsp;keyword as follows.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; money&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;You can also declare multiple variables with the same&amp;nbsp;&lt;strong&gt;var&lt;/strong&gt;&amp;nbsp;keyword as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; money&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Storing a value in a variable is called&amp;nbsp;&lt;strong&gt;variable initialization&lt;/strong&gt;. You can do variable initialization at the time of variable creation or at a later point in time when you need that variable.&lt;/p&gt;
&lt;p&gt;For instance, you might create a variable named&amp;nbsp;&lt;strong&gt;money&lt;/strong&gt;&amp;nbsp;and assign the value 2000.50 to it later. For another variable, you can assign a value at the time of initialization as follows.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Ali&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; money&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      money &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;2000.50&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&amp;nbsp;&amp;minus; Use the&amp;nbsp;&lt;strong&gt;var&lt;/strong&gt;&amp;nbsp;keyword only for declaration or initialization, once for the life of any variable name in a document. You should not re-declare same variable twice.&lt;/p&gt;
&lt;p&gt;JavaScript is&amp;nbsp;&lt;strong&gt;untyped&lt;/strong&gt;&amp;nbsp;language. This means that a JavaScript variable can hold a value of any data type. Unlike many other languages, you don&#39;t have to tell JavaScript during variable declaration what type of value the variable will hold. The value type of a variable can change during the execution of a program and JavaScript takes care of it automatically.&lt;/p&gt;
&lt;h2&gt;JavaScript Variable Scope&lt;/h2&gt;
&lt;p&gt;The scope of a variable is the region of your program in which it is defined. JavaScript variables have only two scopes.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Global Variables&lt;/strong&gt;&amp;nbsp;&amp;minus; A global variable has global scope which means it can be defined anywhere in your JavaScript code.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Local Variables&lt;/strong&gt;&amp;nbsp;&amp;minus; A local variable will be visible only within a function where it is defined. Function parameters are always local to that function.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Within the body of a function, a local variable takes precedence over a global variable with the same name. If you declare a local variable or function parameter with the same name as a global variable, you effectively hide the global variable. Take a look into the following example.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/wAb0EM&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onload&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; checkscope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;   
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myVar &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;global&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;      &lt;span class=&quot;com&quot;&gt;// Declare a global variable&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; checkscope&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myVar &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;local&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;    &lt;span class=&quot;com&quot;&gt;// Declare a local variable&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;myVar&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;     
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This produces the following result &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;local
&lt;/pre&gt;
&lt;h2&gt;JavaScript Variable Names&lt;/h2&gt;
&lt;p&gt;While naming your variables in JavaScript, keep the following rules in mind.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;You should not use any of the JavaScript reserved keywords as a variable name. These keywords are mentioned in the next section. For example,&amp;nbsp;&lt;strong&gt;break&lt;/strong&gt;&amp;nbsp;or&amp;nbsp;&lt;strong&gt;boolean&lt;/strong&gt;&amp;nbsp;variable names are not valid.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;JavaScript variable names should not start with a numeral (0-9). They must begin with a letter or an underscore character. For example,&amp;nbsp;&lt;strong&gt;123test&lt;/strong&gt;&amp;nbsp;is an invalid variable name but&amp;nbsp;&lt;strong&gt;_123test&lt;/strong&gt;&amp;nbsp;is a valid one.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;JavaScript variable names are case-sensitive. For example,&amp;nbsp;&lt;strong&gt;Name&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;name&lt;/strong&gt;are two different variables.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;JavaScript Reserved Words&lt;/h2&gt;
&lt;p&gt;A list of all the reserved words in JavaScript are given in the following table. They cannot be used as JavaScript variables, functions, methods, loop labels, or any object names.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;abstract&lt;/td&gt;
&lt;td&gt;else&lt;/td&gt;
&lt;td&gt;instanceof&lt;/td&gt;
&lt;td&gt;switch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;boolean&lt;/td&gt;
&lt;td&gt;enum&lt;/td&gt;
&lt;td&gt;int&lt;/td&gt;
&lt;td&gt;synchronized&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;break&lt;/td&gt;
&lt;td&gt;export&lt;/td&gt;
&lt;td&gt;interface&lt;/td&gt;
&lt;td&gt;this&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;byte&lt;/td&gt;
&lt;td&gt;extends&lt;/td&gt;
&lt;td&gt;long&lt;/td&gt;
&lt;td&gt;throw&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;case&lt;/td&gt;
&lt;td&gt;false&lt;/td&gt;
&lt;td&gt;native&lt;/td&gt;
&lt;td&gt;throws&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;catch&lt;/td&gt;
&lt;td&gt;final&lt;/td&gt;
&lt;td&gt;new&lt;/td&gt;
&lt;td&gt;transient&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;char&lt;/td&gt;
&lt;td&gt;finally&lt;/td&gt;
&lt;td&gt;null&lt;/td&gt;
&lt;td&gt;true&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;class&lt;/td&gt;
&lt;td&gt;float&lt;/td&gt;
&lt;td&gt;package&lt;/td&gt;
&lt;td&gt;try&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;const&lt;/td&gt;
&lt;td&gt;for&lt;/td&gt;
&lt;td&gt;private&lt;/td&gt;
&lt;td&gt;typeof&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;continue&lt;/td&gt;
&lt;td&gt;function&lt;/td&gt;
&lt;td&gt;protected&lt;/td&gt;
&lt;td&gt;var&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;debugger&lt;/td&gt;
&lt;td&gt;goto&lt;/td&gt;
&lt;td&gt;public&lt;/td&gt;
&lt;td&gt;void&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;default&lt;/td&gt;
&lt;td&gt;if&lt;/td&gt;
&lt;td&gt;return&lt;/td&gt;
&lt;td&gt;volatile&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;delete&lt;/td&gt;
&lt;td&gt;implements&lt;/td&gt;
&lt;td&gt;short&lt;/td&gt;
&lt;td&gt;while&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;do&lt;/td&gt;
&lt;td&gt;import&lt;/td&gt;
&lt;td&gt;static&lt;/td&gt;
&lt;td&gt;with&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;double&lt;/td&gt;
&lt;td&gt;in&lt;/td&gt;
&lt;td&gt;super&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;h1&gt;Operators&lt;/h1&gt;
&lt;h2&gt;What is an Operator?&lt;/h2&gt;
&lt;p&gt;Let us take a simple expression&amp;nbsp;&lt;strong&gt;4 + 5 is equal to 9&lt;/strong&gt;. Here 4 and 5 are called&amp;nbsp;&lt;strong&gt;operands&lt;/strong&gt;and &amp;lsquo;+&amp;rsquo; is called the&amp;nbsp;&lt;strong&gt;operator&lt;/strong&gt;. JavaScript supports the following types of operators.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;Arithmetic Operators&lt;/li&gt;
&lt;li&gt;Comparison Operators&lt;/li&gt;
&lt;li&gt;Logical (or Relational) Operators&lt;/li&gt;
&lt;li&gt;Assignment Operators&lt;/li&gt;
&lt;li&gt;Conditional (or ternary) Operators&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Lets have a look on all operators one by one.&lt;/p&gt;
&lt;h2&gt;Arithmetic Operators&lt;/h2&gt;
&lt;p&gt;JavaScript supports the following arithmetic operators &amp;minus;&lt;/p&gt;
&lt;p&gt;Assume variable A holds 10 and variable B holds 20, then &amp;minus;&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Sr.No.&lt;/th&gt;
&lt;th&gt;Operator &amp;amp; Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;1&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;+ (Addition)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Adds two operands&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ex:&lt;/strong&gt;&amp;nbsp;A + B will give 30&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;2&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;- (Subtraction)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Subtracts the second operand from the first&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ex:&lt;/strong&gt;&amp;nbsp;A - B will give -10&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;3&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;* (Multiplication)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Multiply both operands&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ex:&lt;/strong&gt;&amp;nbsp;A * B will give 200&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;4&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;/ (Division)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Divide the numerator by the denominator&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ex:&lt;/strong&gt;&amp;nbsp;B / A will give 2&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;5&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;% (Modulus)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Outputs the remainder of an integer division&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ex:&lt;/strong&gt;&amp;nbsp;B % A will give 0&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;6&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;++ (Increment)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Increases an integer value by one&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ex:&lt;/strong&gt;&amp;nbsp;A++ will give 11&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;7&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;-- (Decrement)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Decreases an integer value by one&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ex:&lt;/strong&gt;&amp;nbsp;A-- will give 9&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&amp;nbsp;&amp;minus; Addition operator (+) works for Numeric as well as Strings. e.g. &quot;a&quot; + 10 will give &quot;a10&quot;.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;The following code shows how to use arithmetic operators in JavaScript.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/lnSWZs&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
   
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;33&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; c &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Test&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; linebreak &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;a + b = &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;a - b = &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;a / b = &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;a % b = &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;a + b + c = &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; c&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;++a = &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            b &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;--&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;--b = &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;--&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      
      Set the variables to different values and then try...
   &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;a + b = 43
a - b = 23
a / b = 3.3
a % b = 3
a + b + c = 43Test
++a = 35
--b = 8
Set the variables to different values and then try...
&lt;/pre&gt;
&lt;h2&gt;Comparison Operators&lt;/h2&gt;
&lt;p&gt;JavaScript supports the following comparison operators &amp;minus;&lt;/p&gt;
&lt;p&gt;Assume variable A holds 10 and variable B holds 20, then &amp;minus;&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Sr.No.&lt;/th&gt;
&lt;th&gt;Operator &amp;amp; Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;1&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;= = (Equal)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Checks if the value of two operands are equal or not, if yes, then the condition becomes true.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ex:&lt;/strong&gt;&amp;nbsp;(A == B) is not true.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;2&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;!= (Not Equal)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Checks if the value of two operands are equal or not, if the values are not equal, then the condition becomes true.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ex:&lt;/strong&gt;&amp;nbsp;(A != B) is true.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;3&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;&amp;gt; (Greater than)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Checks if the value of the left operand is greater than the value of the right operand, if yes, then the condition becomes true.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ex:&lt;/strong&gt;&amp;nbsp;(A &amp;gt; B) is not true.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;4&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;&amp;lt; (Less than)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Checks if the value of the left operand is less than the value of the right operand, if yes, then the condition becomes true.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ex:&lt;/strong&gt;&amp;nbsp;(A &amp;lt; B) is true.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;5&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;&amp;gt;= (Greater than or Equal to)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Checks if the value of the left operand is greater than or equal to the value of the right operand, if yes, then the condition becomes true.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ex:&lt;/strong&gt;&amp;nbsp;(A &amp;gt;= B) is not true.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;6&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;&amp;lt;= (Less than or Equal to)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Checks if the value of the left operand is less than or equal to the value of the right operand, if yes, then the condition becomes true.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ex:&lt;/strong&gt;&amp;nbsp;(A &amp;lt;= B) is true.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;The following code shows how to use comparison operators in JavaScript.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/vEhWxM&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;  
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; linebreak &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;(a == b) =&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;(a &amp;lt; b) =&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;(a &amp;gt; b) =&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;(a != b) =&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;!=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;(a &amp;gt;= b) =&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;(a &amp;lt;= b) =&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;      
      Set the variables to different values and different operators and then try...
   &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;(a == b) =&amp;gt; false 
(a &amp;lt; b) =&amp;gt; true 
(a &amp;gt; b) =&amp;gt; false 
(a != b) =&amp;gt; true 
(a &amp;gt;= b) =&amp;gt; false 
a &amp;lt;= b) =&amp;gt; true
Set the variables to different values and different operators and then try...
&lt;/pre&gt;
&lt;h2&gt;Logical Operators&lt;/h2&gt;
&lt;p&gt;JavaScript supports the following logical operators &amp;minus;&lt;/p&gt;
&lt;p&gt;Assume variable A holds 10 and variable B holds 20, then &amp;minus;&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Sr.No.&lt;/th&gt;
&lt;th&gt;Operator &amp;amp; Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;1&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;&amp;amp;&amp;amp; (Logical AND)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If both the operands are non-zero, then the condition becomes true.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ex:&lt;/strong&gt;&amp;nbsp;(A &amp;amp;&amp;amp; B) is true.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;2&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;|| (Logical OR)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If any of the two operands are non-zero, then the condition becomes true.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ex:&lt;/strong&gt;&amp;nbsp;(A || B) is true.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;3&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;! (Logical NOT)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Reverses the logical state of its operand. If a condition is true, then the Logical NOT operator will make it false.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ex:&lt;/strong&gt;&amp;nbsp;! (A &amp;amp;&amp;amp; B) is false.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Try the following code to learn how to implement Logical Operators in JavaScript.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/oiAvz6&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;   
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; linebreak &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;(a &amp;amp;&amp;amp; b) =&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;(a || b) =&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;||&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;!(a &amp;amp;&amp;amp; b) =&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(!(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;));&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Set the variables to different values and different operators and then try...&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;(a &amp;amp;&amp;amp; b) =&amp;gt; false 
(a || b) =&amp;gt; true 
!(a &amp;amp;&amp;amp; b) =&amp;gt; true
Set the variables to different values and different operators and then try...
&lt;/pre&gt;
&lt;h2&gt;Bitwise Operators&lt;/h2&gt;
&lt;p&gt;JavaScript supports the following bitwise operators &amp;minus;&lt;/p&gt;
&lt;p&gt;Assume variable A holds 2 and variable B holds 3, then &amp;minus;&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Sr.No.&lt;/th&gt;
&lt;th&gt;Operator &amp;amp; Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;1&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;&amp;amp; (Bitwise AND)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;It performs a Boolean AND operation on each bit of its integer arguments.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ex:&lt;/strong&gt;&amp;nbsp;(A &amp;amp; B) is 2.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;2&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;| (BitWise OR)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;It performs a Boolean OR operation on each bit of its integer arguments.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ex:&lt;/strong&gt;&amp;nbsp;(A | B) is 3.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;3&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;^ (Bitwise XOR)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;It performs a Boolean exclusive OR operation on each bit of its integer arguments. Exclusive OR means that either operand one is true or operand two is true, but not both.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ex:&lt;/strong&gt;&amp;nbsp;(A ^ B) is 1.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;4&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;~ (Bitwise Not)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;It is a unary operator and operates by reversing all the bits in the operand.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ex:&lt;/strong&gt;&amp;nbsp;(~B) is -4.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;5&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;&amp;lt;&amp;lt; (Left Shift)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;It moves all the bits in its first operand to the left by the number of places specified in the second operand. New bits are filled with zeros. Shifting a value left by one position is equivalent to multiplying it by 2, shifting two positions is equivalent to multiplying by 4, and so on.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ex:&lt;/strong&gt;&amp;nbsp;(A &amp;lt;&amp;lt; 1) is 4.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;6&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;&amp;gt;&amp;gt; (Right Shift)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Binary Right Shift Operator. The left operand&amp;rsquo;s value is moved right by the number of bits specified by the right operand.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ex:&lt;/strong&gt;&amp;nbsp;(A &amp;gt;&amp;gt; 1) is 1.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;7&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;&amp;gt;&amp;gt;&amp;gt; (Right shift with Zero)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This operator is just like the &amp;gt;&amp;gt; operator, except that the bits shifted in on the left are always zero.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ex:&lt;/strong&gt;&amp;nbsp;(A &amp;gt;&amp;gt;&amp;gt; 1) is 1.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Try the following code to implement Bitwise operator in JavaScript.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/1auWI8&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;   
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;// Bit presentation 10&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;com&quot;&gt;// Bit presentation 11&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; linebreak &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;(a &amp;amp; b) =&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;(a | b) =&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;(a ^ b) =&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;(~b) =&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(~&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;(a &amp;lt;&amp;lt; b) =&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;(a &amp;gt;&amp;gt; b) =&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Set the variables to different values and different operators and then try...&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;(a &amp;amp; b) =&amp;gt; 2 
(a | b) =&amp;gt; 3 
(a ^ b) =&amp;gt; 1 
(~b) =&amp;gt; -4 
(a &amp;lt;&amp;lt; b) =&amp;gt; 16 
(a &amp;gt;&amp;gt; b) =&amp;gt; 0
Set the variables to different values and different operators and then try...
&lt;/pre&gt;
&lt;h2&gt;Assignment Operators&lt;/h2&gt;
&lt;p&gt;JavaScript supports the following assignment operators &amp;minus;&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Sr.No.&lt;/th&gt;
&lt;th&gt;Operator &amp;amp; Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;1&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;= (Simple Assignment )&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Assigns values from the right side operand to the left side operand&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ex:&lt;/strong&gt;&amp;nbsp;C = A + B will assign the value of A + B into C&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;2&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;+= (Add and Assignment)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;It adds the right operand to the left operand and assigns the result to the left operand.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ex:&lt;/strong&gt;&amp;nbsp;C += A is equivalent to C = C + A&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;3&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;&amp;minus;= (Subtract and Assignment)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;It subtracts the right operand from the left operand and assigns the result to the left operand.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ex:&lt;/strong&gt;&amp;nbsp;C -= A is equivalent to C = C - A&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;4&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;*= (Multiply and Assignment)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;It multiplies the right operand with the left operand and assigns the result to the left operand.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ex:&lt;/strong&gt;&amp;nbsp;C *= A is equivalent to C = C * A&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;5&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;/= (Divide and Assignment)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;It divides the left operand with the right operand and assigns the result to the left operand.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ex:&lt;/strong&gt;&amp;nbsp;C /= A is equivalent to C = C / A&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;6&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;%= (Modules and Assignment)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;It takes modulus using two operands and assigns the result to the left operand.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ex:&lt;/strong&gt;&amp;nbsp;C %= A is equivalent to C = C % A&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&amp;nbsp;&amp;minus; Same logic applies to Bitwise operators so they will become like &amp;lt;&amp;lt;=, &amp;gt;&amp;gt;=, &amp;gt;&amp;gt;=, &amp;amp;=, |= and ^=.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Try the following code to implement assignment operator in JavaScript.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/tmlXco&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;   
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;33&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; linebreak &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Value of a =&amp;gt; (a = b) =&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Value of a =&amp;gt; (a += b) =&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Value of a =&amp;gt; (a -= b) =&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Value of a =&amp;gt; (a *= b) =&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;*=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Value of a =&amp;gt; (a /= b) =&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Value of a =&amp;gt; (a %= b) =&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Set the variables to different values and different operators and then try...&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;Value of a =&amp;gt; (a = b) =&amp;gt; 10
Value of a =&amp;gt; (a += b) =&amp;gt; 20 
Value of a =&amp;gt; (a -= b) =&amp;gt; 10 
Value of a =&amp;gt; (a *= b) =&amp;gt; 100 
Value of a =&amp;gt; (a /= b) =&amp;gt; 10
Value of a =&amp;gt; (a %= b) =&amp;gt; 0
Set the variables to different values and different operators and then try...
&lt;/pre&gt;
&lt;h2&gt;Miscellaneous Operator&lt;/h2&gt;
&lt;p&gt;We will discuss two operators here that are quite useful in JavaScript: the&amp;nbsp;&lt;strong&gt;conditional operator&lt;/strong&gt;&amp;nbsp;(? :) and the&amp;nbsp;&lt;strong&gt;typeof operator&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;Conditional Operator (? :)&lt;/h3&gt;
&lt;p&gt;The conditional operator first evaluates an expression for a true or false value and then executes one of the two given statements depending upon the result of the evaluation.&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th width=&quot;10%&quot;&gt;Sr.No.&lt;/th&gt;
&lt;th&gt;Operator and Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;1&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;? : (Conditional )&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If Condition is true? Then value X : Otherwise value Y&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Try the following code to understand how the Conditional Operator works in JavaScript.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/nqssTK&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;   
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; linebreak &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;((a &amp;gt; b) ? 100 : 200) =&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;((a &amp;lt; b) ? 100 : 200) =&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Set the variables to different values and different operators and then try...&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;((a &amp;gt; b) ? 100 : 200) =&amp;gt; 200 
((a &amp;lt; b) ? 100 : 200) =&amp;gt; 100
Set the variables to different values and different operators and then try...
&lt;/pre&gt;
&lt;h2&gt;typeof Operator&lt;/h2&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;typeof&lt;/strong&gt;&amp;nbsp;operator is a unary operator that is placed before its single operand, which can be of any type. Its value is a string indicating the data type of the operand.&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;&lt;em&gt;typeof&lt;/em&gt;&amp;nbsp;operator evaluates to &quot;number&quot;, &quot;string&quot;, or &quot;boolean&quot; if its operand is a number, string, or boolean value and returns true or false based on the evaluation.&lt;/p&gt;
&lt;p&gt;Here is a list of the return values for the&amp;nbsp;&lt;strong&gt;typeof&lt;/strong&gt;&amp;nbsp;Operator.&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th width=&quot;20%&quot;&gt;Type&lt;/th&gt;
&lt;th&gt;String Returned by typeof&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Number&lt;/td&gt;
&lt;td&gt;&quot;number&quot;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;String&lt;/td&gt;
&lt;td&gt;&quot;string&quot;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Boolean&lt;/td&gt;
&lt;td&gt;&quot;boolean&quot;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Object&lt;/td&gt;
&lt;td&gt;&quot;object&quot;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Function&lt;/td&gt;
&lt;td&gt;&quot;function&quot;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Undefined&lt;/td&gt;
&lt;td&gt;&quot;undefined&quot;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Null&lt;/td&gt;
&lt;td&gt;&quot;object&quot;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;The following code shows how to implement&amp;nbsp;&lt;strong&gt;typeof&lt;/strong&gt;&amp;nbsp;operator.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/oKWzuc&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;String&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; linebreak &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;typeof&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;string&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;B is String&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;B is Numeric&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Result =&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;typeof&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;string&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;A is String&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;A is Numeric&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Result =&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;linebreak&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Set the variables to different values and different operators and then try...&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;Result =&amp;gt; B is String 
Result =&amp;gt; A is Numeric
Set the variables to different values and different operators and then try...&lt;/pre&gt;

&lt;h1&gt;If...Else&lt;/h1&gt;
&lt;p&gt;While writing a program, there may be a situation when you need to adopt one out of a given set of paths. In such cases, you need to use conditional statements that allow your program to make correct decisions and perform right actions.&lt;/p&gt;
&lt;p&gt;JavaScript supports conditional statements which are used to perform different actions based on different conditions. Here we will explain the&amp;nbsp;&lt;strong&gt;if..else&lt;/strong&gt;&amp;nbsp;statement.&lt;/p&gt;
&lt;h2&gt;Flow Chart of if-else&lt;/h2&gt;
&lt;p&gt;The following flow chart shows how the if-else statement works.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/javascript/images/decision_making.jpg&quot; alt=&quot;Decision Making&quot; /&gt;&lt;/p&gt;
&lt;p&gt;JavaScript supports the following forms of&amp;nbsp;&lt;strong&gt;if..else&lt;/strong&gt;&amp;nbsp;statement &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;if statement&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;if...else statement&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;if...else if... statement.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;if statement&lt;/h2&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;if&lt;/strong&gt;&amp;nbsp;statement is the fundamental control statement that allows JavaScript to make decisions and execute statements conditionally.&lt;/p&gt;
&lt;h3&gt;Syntax&lt;/h3&gt;
&lt;p&gt;The syntax for a basic if statement is as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;if (expression) {
   Statement(s) to be executed if expression is true
}
&lt;/pre&gt;
&lt;p&gt;Here a JavaScript expression is evaluated. If the resulting value is true, the given statement(s) are executed. If the expression is false, then no statement would be not executed. Most of the times, you will use comparison operators while making decisions.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Try the following example to understand how the&amp;nbsp;&lt;strong&gt;if&lt;/strong&gt;&amp;nbsp;statement works.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/phmRNV&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;     
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; age &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
         
            &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; age &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;18&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;b&amp;gt;Qualifies for driving&amp;lt;/b&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Set the variable to different value and then try...&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&lt;strong&gt;Qualifies for driving&lt;/strong&gt;
Set the variable to different value and then try...
&lt;/pre&gt;
&lt;h2&gt;if...else statement&lt;/h2&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;&#39;if...else&#39;&lt;/strong&gt;&amp;nbsp;statement is the next form of control statement that allows JavaScript to execute statements in a more controlled way.&lt;/p&gt;
&lt;h3&gt;Syntax&lt;/h3&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;if (expression) {
   Statement(s) to be executed if expression is true
} else {
   Statement(s) to be executed if expression is false
}
&lt;/pre&gt;
&lt;p&gt;Here JavaScript expression is evaluated. If the resulting value is true, the given statement(s) in the &amp;lsquo;if&amp;rsquo; block, are executed. If the expression is false, then the given statement(s) in the else block are executed.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Try the following code to learn how to implement an if-else statement in JavaScript.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/B5GzT5&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;   
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; age &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
         
            &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; age &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;18&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;b&amp;gt;Qualifies for driving&amp;lt;/b&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;b&amp;gt;Does not qualify for driving&amp;lt;/b&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;     
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Set the variable to different value and then try...&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&lt;strong&gt;Does not qualify for driving&lt;/strong&gt;
Set the variable to different value and then try...
&lt;/pre&gt;
&lt;h2&gt;if...else if... statement&lt;/h2&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;if...else if...&lt;/strong&gt;&amp;nbsp;statement is an advanced form of&amp;nbsp;&lt;strong&gt;if&amp;hellip;else&lt;/strong&gt;&amp;nbsp;that allows JavaScript to make a correct decision out of several conditions.&lt;/p&gt;
&lt;h3&gt;Syntax&lt;/h3&gt;
&lt;p&gt;The syntax of an if-else-if statement is as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;if (expression 1) {
   Statement(s) to be executed if expression 1 is true
} else if (expression 2) {
   Statement(s) to be executed if expression 2 is true
} else if (expression 3) {
   Statement(s) to be executed if expression 3 is true
} else {
   Statement(s) to be executed if no expression is true
}
&lt;/pre&gt;
&lt;p&gt;There is nothing special about this code. It is just a series of&amp;nbsp;&lt;strong&gt;if&lt;/strong&gt;&amp;nbsp;statements, where each&amp;nbsp;&lt;strong&gt;if&lt;/strong&gt;is a part of the&amp;nbsp;&lt;strong&gt;else&lt;/strong&gt;&amp;nbsp;clause of the previous statement. Statement(s) are executed based on the true condition, if none of the conditions is true, then the&amp;nbsp;&lt;strong&gt;else&lt;/strong&gt;&amp;nbsp;block is executed.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Try the following code to learn how to implement an if-else-if statement in JavaScript.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/NTcFyX&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;   
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; book &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;maths&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; book &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;history&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;b&amp;gt;History Book&amp;lt;/b&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; book &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;maths&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;b&amp;gt;Maths Book&amp;lt;/b&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; book &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;economics&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;b&amp;gt;Economics Book&amp;lt;/b&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;b&amp;gt;Unknown Book&amp;lt;/b&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Set the variable to different value and then try...&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&lt;strong&gt;Maths Book&lt;/strong&gt;
Set the variable to different value and then try...&lt;/pre&gt;

&lt;h1&gt;Switch Case&lt;/h1&gt;
&lt;p&gt;You can use multiple&amp;nbsp;&lt;strong&gt;if...else&amp;hellip;if&lt;/strong&gt;&amp;nbsp;statements, as in the previous chapter, to perform a multiway branch. However, this is not always the best solution, especially when all of the branches depend on the value of a single variable.&lt;/p&gt;
&lt;p&gt;Starting with JavaScript 1.2, you can use a&amp;nbsp;&lt;strong&gt;switch&lt;/strong&gt;&amp;nbsp;statement which handles exactly this situation, and it does so more efficiently than repeated&amp;nbsp;&lt;strong&gt;if...else if&lt;/strong&gt;&amp;nbsp;statements.&lt;/p&gt;
&lt;h2&gt;Flow Chart&lt;/h2&gt;
&lt;p&gt;The following flow chart explains a switch-case statement works.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/javascript/images/switch_case.jpg&quot; alt=&quot;Switch case&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Syntax&lt;/h3&gt;
&lt;p&gt;The objective of a&amp;nbsp;&lt;strong&gt;switch&lt;/strong&gt;&amp;nbsp;statement is to give an expression to evaluate and several different statements to execute based on the value of the expression. The interpreter checks each&amp;nbsp;&lt;strong&gt;case&lt;/strong&gt;&amp;nbsp;against the value of the expression until a match is found. If nothing matches, a&amp;nbsp;&lt;strong&gt;default&lt;/strong&gt;&amp;nbsp;condition will be used.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;switch (expression) {
   case condition 1: statement(s)
   break;
   
   case condition 2: statement(s)
   break;
   ...
   
   case condition n: statement(s)
   break;
   
   default: statement(s)
}
&lt;/pre&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;break&lt;/strong&gt;&amp;nbsp;statements indicate the end of a particular case. If they were omitted, the interpreter would continue executing each statement in each of the following cases.&lt;/p&gt;
&lt;p&gt;We will explain&amp;nbsp;&lt;strong&gt;break&lt;/strong&gt;&amp;nbsp;statement in&amp;nbsp;&lt;strong&gt;Loop Control&lt;/strong&gt;&amp;nbsp;chapter.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Try the following example to implement switch-case statement.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/pNWbNd&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;   
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; grade &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;A&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Entering switch block&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;switch&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;grade&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;A&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Good job&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
            
               &lt;span class=&quot;kwd&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;B&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Pretty good&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
            
               &lt;span class=&quot;kwd&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;C&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Passed&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
            
               &lt;span class=&quot;kwd&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;D&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Not so good&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
            
               &lt;span class=&quot;kwd&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;F&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Failed&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
            
               &lt;span class=&quot;kwd&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;  document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Unknown grade&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Exiting switch block&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Set the variable to different value and then try...&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;Entering switch block
Good job
Exiting switch block
Set the variable to different value and then try...
&lt;/pre&gt;
&lt;p&gt;Break statements play a major role in switch-case statements. Try the following code that uses switch-case statement without any break statement.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/ouqbd3&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; grade &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;A&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Entering switch block&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;switch&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;grade&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;A&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Good job&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;B&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Pretty good&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;C&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Passed&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;D&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Not so good&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;F&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Failed&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Unknown grade&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Exiting switch block&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Set the variable to different value and then try...&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;Entering switch block
Good job
Pretty good
Passed
Not so good
Failed
Unknown grade
Exiting switch block
Set the variable to different value and then try...&lt;/pre&gt;

&lt;h1&gt;While Loop&lt;/h1&gt;
&lt;p&gt;While writing a program, you may encounter a situation where you need to perform an action over and over again. In such situations, you would need to write loop statements to reduce the number of lines.&lt;/p&gt;
&lt;p&gt;JavaScript supports all the necessary loops to ease down the pressure of programming.&lt;/p&gt;
&lt;h2&gt;The while Loop&lt;/h2&gt;
&lt;p&gt;The most basic loop in JavaScript is the&amp;nbsp;&lt;strong&gt;while&lt;/strong&gt;&amp;nbsp;loop which would be discussed in this chapter. The purpose of a&amp;nbsp;&lt;strong&gt;while&lt;/strong&gt;&amp;nbsp;loop is to execute a statement or code block repeatedly as long as an&amp;nbsp;&lt;strong&gt;expression&lt;/strong&gt;&amp;nbsp;is true. Once the expression becomes&amp;nbsp;&lt;strong&gt;false,&lt;/strong&gt;&amp;nbsp;the loop terminates.&lt;/p&gt;
&lt;h3&gt;Flow Chart&lt;/h3&gt;
&lt;p&gt;The flow chart of&amp;nbsp;&lt;strong&gt;while loop&lt;/strong&gt;&amp;nbsp;looks as follows &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/javascript/images/while_loop.jpg&quot; alt=&quot;While loop&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Syntax&lt;/h3&gt;
&lt;p&gt;The syntax of&amp;nbsp;&lt;strong&gt;while loop&lt;/strong&gt;&amp;nbsp;in JavaScript is as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;while (expression) {
   Statement(s) to be executed if expression is true
}
&lt;/pre&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Try the following example to implement while loop.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/lIlHQD&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; count &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Starting Loop &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         
            &lt;span class=&quot;kwd&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;count &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Current Count : &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; count &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               count&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;++;&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Loop stopped!&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Set the variable to different value and then try...&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;Starting Loop
Current Count : 0
Current Count : 1
Current Count : 2
Current Count : 3
Current Count : 4
Current Count : 5
Current Count : 6
Current Count : 7
Current Count : 8
Current Count : 9
Loop stopped!
Set the variable to different value and then try... 
&lt;/pre&gt;
&lt;h2&gt;The do...while Loop&lt;/h2&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;do...while&lt;/strong&gt;&amp;nbsp;loop is similar to the&amp;nbsp;&lt;strong&gt;while&lt;/strong&gt;&amp;nbsp;loop except that the condition check happens at the end of the loop. This means that the loop will always be executed at least once, even if the condition is&amp;nbsp;&lt;strong&gt;false&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;Flow Chart&lt;/h3&gt;
&lt;p&gt;The flow chart of a&amp;nbsp;&lt;strong&gt;do-while&lt;/strong&gt;&amp;nbsp;loop would be as follows &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/javascript/images/do_while_loop.jpg&quot; alt=&quot;Do While Loop&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Syntax&lt;/h3&gt;
&lt;p&gt;The syntax for&amp;nbsp;&lt;strong&gt;do-while&lt;/strong&gt;&amp;nbsp;loop in JavaScript is as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;do {
   Statement(s) to be executed;
} while (expression);
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&amp;nbsp;&amp;minus; Don&amp;rsquo;t miss the semicolon used at the end of the&amp;nbsp;&lt;strong&gt;do...while&lt;/strong&gt;&amp;nbsp;loop.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Try the following example to learn how to implement a&amp;nbsp;&lt;strong&gt;do-while&lt;/strong&gt;&amp;nbsp;loop in JavaScript.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/HCE78l&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;   
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; count &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Starting Loop&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Current Count : &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; count &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               count&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;++;&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            
            &lt;span class=&quot;kwd&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;count &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Loop stopped!&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Set the variable to different value and then try...&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;Starting Loop
Current Count : 0 
Current Count : 1 
Current Count : 2 
Current Count : 3 
Current Count : 4
Loop Stopped!
Set the variable to different value and then try...&lt;/pre&gt;

&lt;h1&gt;For Loop&lt;/h1&gt;
&lt;p&gt;The &#39;&lt;strong&gt;for&lt;/strong&gt;&#39; loop is the most compact form of looping. It includes the following three important parts &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;loop initialization&lt;/strong&gt;&amp;nbsp;where we initialize our counter to a starting value. The initialization statement is executed before the loop begins.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;test statement&lt;/strong&gt;&amp;nbsp;which will test if a given condition is true or not. If the condition is true, then the code given inside the loop will be executed, otherwise the control will come out of the loop.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;iteration statement&lt;/strong&gt;&amp;nbsp;where you can increase or decrease your counter.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can put all the three parts in a single line separated by semicolons.&lt;/p&gt;
&lt;h2&gt;Flow Chart&lt;/h2&gt;
&lt;p&gt;The flow chart of a&amp;nbsp;&lt;strong&gt;for&lt;/strong&gt;&amp;nbsp;loop in JavaScript would be as follows &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/javascript/images/for_loop.jpg&quot; alt=&quot;For Loop&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Syntax&lt;/h3&gt;
&lt;p&gt;The syntax of&amp;nbsp;&lt;strong&gt;for&lt;/strong&gt;&amp;nbsp;loop is JavaScript is as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;for (initialization; test condition; iteration statement) {
   Statement(s) to be executed if test condition is true
}
&lt;/pre&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Try the following example to learn how a&amp;nbsp;&lt;strong&gt;for&lt;/strong&gt;&amp;nbsp;loop works in JavaScript.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/YiJzji&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; count&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Starting Loop&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         
            &lt;span class=&quot;kwd&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;count &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; count &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; count&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;++)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Current Count : &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; count &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;         
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Loop stopped!&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Set the variable to different value and then try...&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;Starting Loop
Current Count : 0
Current Count : 1
Current Count : 2
Current Count : 3
Current Count : 4
Current Count : 5
Current Count : 6
Current Count : 7
Current Count : 8
Current Count : 9
Loop stopped! 
Set the variable to different value and then try...&lt;/pre&gt;

&lt;h1&gt;Loop Control&lt;/h1&gt;
&lt;p&gt;JavaScript provides full control to handle loops and switch statements. There may be a situation when you need to come out of a loop without reaching its bottom. There may also be a situation when you want to skip a part of your code block and start the next iteration of the loop.&lt;/p&gt;
&lt;p&gt;To handle all such situations, JavaScript provides&amp;nbsp;&lt;strong&gt;break&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;continue&lt;/strong&gt;&amp;nbsp;statements. These statements are used to immediately come out of any loop or to start the next iteration of any loop respectively.&lt;/p&gt;
&lt;h2&gt;The break Statement&lt;/h2&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;break&lt;/strong&gt;&amp;nbsp;statement, which was briefly introduced with the&amp;nbsp;&lt;em&gt;switch&lt;/em&gt;&amp;nbsp;statement, is used to exit a loop early, breaking out of the enclosing curly braces.&lt;/p&gt;
&lt;h3&gt;Flow Chart&lt;/h3&gt;
&lt;p&gt;The flow chart of a break statement would look as follows &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/javascript/images/break_statement.jpg&quot; alt=&quot;Break Statement&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;The following example illustrates the use of a&amp;nbsp;&lt;strong&gt;break&lt;/strong&gt;&amp;nbsp;statement with a while loop. Notice how the loop breaks out early once&amp;nbsp;&lt;strong&gt;x&lt;/strong&gt;&amp;nbsp;reaches 5 and reaches to&amp;nbsp;&lt;strong&gt;document.write (..)&lt;/strong&gt;statement just below to the closing curly brace &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/Um7xDo&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;     
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; x &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Entering the loop&amp;lt;br /&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         
         &lt;span class=&quot;kwd&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;x &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;x &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;   &lt;span class=&quot;com&quot;&gt;// breaks out of loop completely&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            x &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; x &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; x &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;         
         document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Exiting the loop!&amp;lt;br /&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Set the variable to different value and then try...&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;Entering the loop
2
3
4
5
Exiting the loop!
Set the variable to different value and then try...
&lt;/pre&gt;
&lt;p&gt;We already have seen the usage of&amp;nbsp;&lt;strong&gt;break&lt;/strong&gt;&amp;nbsp;statement inside&amp;nbsp;&lt;strong&gt;a switch&lt;/strong&gt;&amp;nbsp;statement.&lt;/p&gt;
&lt;h2&gt;The continue Statement&lt;/h2&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;continue&lt;/strong&gt;&amp;nbsp;statement tells the interpreter to immediately start the next iteration of the loop and skip the remaining code block. When a&amp;nbsp;&lt;strong&gt;continue&lt;/strong&gt;&amp;nbsp;statement is encountered, the program flow moves to the loop check expression immediately and if the condition remains true, then it starts the next iteration, otherwise the control comes out of the loop.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;This example illustrates the use of a&amp;nbsp;&lt;strong&gt;continue&lt;/strong&gt;&amp;nbsp;statement with a while loop. Notice how the&amp;nbsp;&lt;strong&gt;continue&lt;/strong&gt;&amp;nbsp;statement is used to skip printing when the index held in variable&amp;nbsp;&lt;strong&gt;x&lt;/strong&gt;&amp;nbsp;reaches 5 &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/mBbb2C&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; x &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Entering the loop&amp;lt;br /&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         
            &lt;span class=&quot;kwd&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;x &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               x &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; x &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
               
               &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;x &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;continue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;   &lt;span class=&quot;com&quot;&gt;// skip rest of the loop body&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; x &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;         
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Exiting the loop!&amp;lt;br /&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Set the variable to different value and then try...&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;Entering the loop
2
3
4
6
7
8
9
10
Exiting the loop!
Set the variable to different value and then try...
&lt;/pre&gt;
&lt;h2&gt;Using Labels to Control the Flow&lt;/h2&gt;
&lt;p&gt;Starting from JavaScript 1.2, a label can be used with&amp;nbsp;&lt;strong&gt;break&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;continue&lt;/strong&gt;&amp;nbsp;to control the flow more precisely. A&amp;nbsp;&lt;strong&gt;label&lt;/strong&gt;&amp;nbsp;is simply an identifier followed by a colon (:) that is applied to a statement or a block of code. We will see two different examples to understand how to use labels with break and continue.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&amp;nbsp;&amp;minus; Line breaks are not allowed between the&amp;nbsp;&lt;strong&gt;&amp;lsquo;continue&amp;rsquo;&lt;/strong&gt;&amp;nbsp;or&amp;nbsp;&lt;strong&gt;&amp;lsquo;break&amp;rsquo;&lt;/strong&gt;&amp;nbsp;statement and its label name. Also, there should not be any other statement in between a label name and associated loop.&lt;/p&gt;
&lt;p&gt;Try the following two examples for a better understanding of Labels.&lt;/p&gt;
&lt;h3&gt;Example 1&lt;/h3&gt;
&lt;p&gt;The following example shows how to implement Label with a break statement.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/voKP9K&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Entering the loop!&amp;lt;br /&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            outerloop&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;        &lt;span class=&quot;com&quot;&gt;// This is the label name         &lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; i &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; i &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; i&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;++)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Outerloop: &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; i &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               innerloop&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; j &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; j &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; j&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;++)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;j &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;3&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;break&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;           &lt;span class=&quot;com&quot;&gt;// Quit the innermost loop&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;i &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; innerloop&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;com&quot;&gt;// Do the same thing&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;i &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; outerloop&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;com&quot;&gt;// Quit the outer loop&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Innerloop: &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; j &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot; &amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;        
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Exiting the loop!&amp;lt;br /&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;Entering the loop!
Outerloop: 0
Innerloop: 0 
Innerloop: 1 
Innerloop: 2 
Innerloop: 3 
Outerloop: 1
Innerloop: 0 
Innerloop: 1 
Innerloop: 2 
Innerloop: 3 
Outerloop: 2
Outerloop: 3
Innerloop: 0 
Innerloop: 1 
Innerloop: 2 
Innerloop: 3 
Outerloop: 4
Exiting the loop!
&lt;/pre&gt;
&lt;h3&gt;Example 2&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/P8njxO&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
   
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Entering the loop!&amp;lt;br /&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         outerloop&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;     &lt;span class=&quot;com&quot;&gt;// This is the label name&lt;/span&gt;
         
         &lt;span class=&quot;kwd&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; i &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; i &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; i&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;++)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Outerloop: &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; i &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; j &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; j &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; j&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;++)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;j &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;continue&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; outerloop&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Innerloop: &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; j &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;br /&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         
         document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Exiting the loop!&amp;lt;br /&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;Entering the loop!
Outerloop: 0
Innerloop: 0
Innerloop: 1
Innerloop: 2
Outerloop: 1
Innerloop: 0
Innerloop: 1
Innerloop: 2
Outerloop: 2
Innerloop: 0
Innerloop: 1
Innerloop: 2
Exiting the loop!&lt;/pre&gt;

&lt;h1&gt;Functions&lt;/h1&gt;
&lt;p&gt;A function is a group of reusable code which can be called anywhere in your program. This eliminates the need of writing the same code again and again. It helps programmers in writing modular codes. Functions allow a programmer to divide a big program into a number of small and manageable functions.&lt;/p&gt;
&lt;p&gt;Like any other advanced programming language, JavaScript also supports all the features necessary to write modular code using functions. You must have seen functions like&amp;nbsp;&lt;strong&gt;alert()&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;write()&lt;/strong&gt;&amp;nbsp;in the earlier chapters. We were using these functions again and again, but they had been written in core JavaScript only once.&lt;/p&gt;
&lt;p&gt;JavaScript allows us to write our own functions as well. This section explains how to write your own functions in JavaScript.&lt;/p&gt;
&lt;h2&gt;Function Definition&lt;/h2&gt;
&lt;p&gt;Before we use a function, we need to define it. The most common way to define a function in JavaScript is by using the&amp;nbsp;&lt;strong&gt;function&lt;/strong&gt;&amp;nbsp;keyword, followed by a unique function name, a list of parameters (that might be empty), and a statement block surrounded by curly braces.&lt;/p&gt;
&lt;h3&gt;Syntax&lt;/h3&gt;
&lt;p&gt;The basic syntax is shown here.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&amp;lt;script type = &quot;text/javascript&quot;&amp;gt;
   &amp;lt;!--
      function functionname(parameter-list) {
         statements
      }
   //--&amp;gt;
&amp;lt;/script&amp;gt;
&lt;/pre&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Try the following example. It defines a function called sayHello that takes no parameters &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; sayHello&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Hello there&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;Calling a Function&lt;/h2&gt;
&lt;p&gt;To invoke a function somewhere later in the script, you would simply need to write the name of that function as shown in the following code.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/A40B7m&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;   
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; sayHello&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Hello there!&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click the following button to call the function&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;form&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;button&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onclick&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;sayHello&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Say Hello&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Use different text in write method and then try...&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/javascript/src/calling_function.htm&quot; width=&quot;600px&quot; height=&quot;120px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Function Parameters&lt;/h2&gt;
&lt;p&gt;Till now, we have seen functions without parameters. But there is a facility to pass different parameters while calling a function. These passed parameters can be captured inside the function and any manipulation can be done over those parameters. A function can take multiple parameters separated by comma.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Try the following example. We have modified our&amp;nbsp;&lt;strong&gt;sayHello&lt;/strong&gt;&amp;nbsp;function here. Now it takes two parameters.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/Gp7CF7&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;   
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; sayHello&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; age&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot; is &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; age &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot; years old.&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click the following button to call the function&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;form&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;button&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onclick&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;sayHello&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Zara&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Say Hello&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Use different parameters inside the function and then try...&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/javascript/src/function_parameter.htm&quot; width=&quot;600px&quot; height=&quot;120px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;The return Statement&lt;/h2&gt;
&lt;p&gt;A JavaScript function can have an optional&amp;nbsp;&lt;strong&gt;return&lt;/strong&gt;&amp;nbsp;statement. This is required if you want to return a value from a function. This statement should be the last statement in a function.&lt;/p&gt;
&lt;p&gt;For example, you can pass two numbers in a function and then you can expect the function to return their multiplication in your calling program.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Try the following example. It defines a function that takes two parameters and concatenates them before returning the resultant in the calling program.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/CFRAKh&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;  
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; concatenate&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;first&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; last&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; full&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            full &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; first &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; last&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; full&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; secondFunction&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; concatenate&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Zara&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Ali&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click the following button to call the function&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;form&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;button&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onclick&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;secondFunction&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Call Function&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Use different parameters inside the function and then try...&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;  
  &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/javascript/src/return_statement.htm&quot; width=&quot;600px&quot; height=&quot;120px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;There is a lot to learn about JavaScript functions, however we have covered the most important concepts in this tutorial.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;a title=&quot;JavaScript Nested Functions&quot; href=&quot;https://www.tutorialspoint.com/javascript/javascript_nested_functions.htm&quot;&gt;JavaScript Nested Functions&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a title=&quot;JavaScript Function Constructors&quot; href=&quot;https://www.tutorialspoint.com/javascript/javascript_function_constructors.htm&quot;&gt;JavaScript Function( ) Constructor&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a title=&quot;JavaScript Function Literals&quot; href=&quot;https://www.tutorialspoint.com/javascript/javascript_function_literals.htm&quot;&gt;JavaScript Function Literals&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;Events&lt;/h1&gt;
&lt;h2&gt;What is an Event ?&lt;/h2&gt;
&lt;p&gt;JavaScript&#39;s interaction with HTML is handled through events that occur when the user or the browser manipulates a page.&lt;/p&gt;
&lt;p&gt;When the page loads, it is called an event. When the user clicks a button, that click too is an event. Other examples include events like pressing any key, closing a window, resizing a window, etc.&lt;/p&gt;
&lt;p&gt;Developers can use these events to execute JavaScript coded responses, which cause buttons to close windows, messages to be displayed to users, data to be validated, and virtually any other type of response imaginable.&lt;/p&gt;
&lt;p&gt;Events are a part of the Document Object Model (DOM) Level 3 and every HTML element contains a set of events which can trigger JavaScript Code.&lt;/p&gt;
&lt;p&gt;Please go through this small tutorial for a better understanding&amp;nbsp;&lt;a href=&quot;https://www.tutorialspoint.com/html/html_events_ref.htm&quot;&gt;HTML Event Reference&lt;/a&gt;. Here we will see a few examples to understand a relation between Event and JavaScript &amp;minus;&lt;/p&gt;
&lt;h2&gt;onclick Event Type&lt;/h2&gt;
&lt;p&gt;This is the most frequently used event type which occurs when a user clicks the left button of his mouse. You can put your validation, warning etc., against this event type.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Try the following example.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/iyeFLu&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;   
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; sayHello&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Hello World&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click the following button and see result&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;form&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;button&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onclick&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;sayHello&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Say Hello&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/javascript/src/onclick_event.htm&quot; width=&quot;600px&quot; height=&quot;90px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;onsubmit Event Type&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;onsubmit&lt;/strong&gt;&amp;nbsp;is an event that occurs when you try to submit a form. You can put your form validation against this event type.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;The following example shows how to use onsubmit. Here we are calling a&amp;nbsp;&lt;strong&gt;validate()&lt;/strong&gt;function before submitting a form data to the webserver. If&amp;nbsp;&lt;strong&gt;validate()&lt;/strong&gt;&amp;nbsp;function returns true, the form will be submitted, otherwise it will not submit the data.&lt;/p&gt;
&lt;p&gt;Try the following example.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;   
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; validation&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               all validation goes here
               &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.........&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; either &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; or &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;false&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;   
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;form&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;method&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;POST&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;action&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;t.cgi&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onsubmit&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; validate&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         .......
         &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;submit&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Submit&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;onmouseover and onmouseout&lt;/h2&gt;
&lt;p&gt;These two event types will help you create nice effects with images or even with text as well. The&amp;nbsp;&lt;strong&gt;onmouseover&lt;/strong&gt;&amp;nbsp;event triggers when you bring your mouse over any element and the&amp;nbsp;&lt;strong&gt;onmouseout&lt;/strong&gt;&amp;nbsp;triggers when you move your mouse out from that element. Try the following example.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/o3Bzlo&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;   
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; over&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Mouse Over&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;            
            &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; out&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Mouse Out&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;            
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Bring your mouse inside the division to see the result:&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onmouseover&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;over&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onmouseout&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; This is inside the division &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;         
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/javascript/src/onmouseover_evnet.htm&quot; width=&quot;600px&quot; height=&quot;120px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;HTML 5 Standard Events&lt;/h2&gt;
&lt;p&gt;The standard HTML 5 events are listed here for your reference. Here script indicates a Javascript function to be executed against that event.&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Attribute&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Offline&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when the document goes offline&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Onabort&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers on an abort event&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onafterprint&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers after the document is printed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onbeforeonload&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers before the document loads&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onbeforeprint&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers before the document is printed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onblur&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when the window loses focus&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;oncanplay&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when media can start play, but might has to stop for buffering&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;oncanplaythrough&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when media can be played to the end, without stopping for buffering&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onchange&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when an element changes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onclick&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers on a mouse click&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;oncontextmenu&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when a context menu is triggered&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ondblclick&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers on a mouse double-click&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ondrag&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when an element is dragged&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ondragend&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers at the end of a drag operation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ondragenter&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when an element has been dragged to a valid drop target&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ondragleave&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when an element is being dragged over a valid drop target&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ondragover&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers at the start of a drag operation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ondragstart&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers at the start of a drag operation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ondrop&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when dragged element is being dropped&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ondurationchange&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when the length of the media is changed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onemptied&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when a media resource element suddenly becomes empty.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onended&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when media has reach the end&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onerror&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when an error occur&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onfocus&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when the window gets focus&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onformchange&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when a form changes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onforminput&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when a form gets user input&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onhaschange&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when the document has change&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;oninput&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when an element gets user input&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;oninvalid&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when an element is invalid&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onkeydown&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when a key is pressed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onkeypress&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when a key is pressed and released&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onkeyup&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when a key is released&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onload&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when the document loads&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onloadeddata&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when media data is loaded&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onloadedmetadata&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when the duration and other media data of a media element is loaded&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onloadstart&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when the browser starts to load the media data&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onmessage&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when the message is triggered&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onmousedown&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when a mouse button is pressed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onmousemove&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when the mouse pointer moves&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onmouseout&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when the mouse pointer moves out of an element&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onmouseover&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when the mouse pointer moves over an element&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onmouseup&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when a mouse button is released&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onmousewheel&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when the mouse wheel is being rotated&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onoffline&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when the document goes offline&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onoine&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when the document comes online&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ononline&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when the document comes online&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onpagehide&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when the window is hidden&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onpageshow&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when the window becomes visible&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onpause&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when media data is paused&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onplay&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when media data is going to start playing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onplaying&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when media data has start playing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onpopstate&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when the window&#39;s history changes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onprogress&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when the browser is fetching the media data&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onratechange&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when the media data&#39;s playing rate has changed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onreadystatechange&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when the ready-state changes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onredo&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when the document performs a redo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onresize&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when the window is resized&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onscroll&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when an element&#39;s scrollbar is being scrolled&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onseeked&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when a media element&#39;s seeking attribute is no longer true, and the seeking has ended&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onseeking&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when a media element&#39;s seeking attribute is true, and the seeking has begun&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onselect&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when an element is selected&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onstalled&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when there is an error in fetching media data&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onstorage&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when a document loads&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onsubmit&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when a form is submitted&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onsuspend&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when the browser has been fetching media data, but stopped before the entire media file was fetched&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ontimeupdate&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when media changes its playing position&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onundo&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when a document performs an undo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onunload&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when the user leaves the document&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onvolumechange&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when media changes the volume, also when volume is set to &quot;mute&quot;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;onwaiting&lt;/td&gt;
&lt;td&gt;script&lt;/td&gt;
&lt;td&gt;Triggers when media has stopped playing, but is expected to resume&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;h1&gt;Cookies&lt;/h1&gt;
&lt;h2&gt;What are Cookies ?&lt;/h2&gt;
&lt;p&gt;Web Browsers and Servers use HTTP protocol to communicate and HTTP is a stateless protocol. But for a commercial website, it is required to maintain session information among different pages. For example, one user registration ends after completing many pages. But how to maintain users&#39; session information across all the web pages.&lt;/p&gt;
&lt;p&gt;In many situations, using cookies is the most efficient method of remembering and tracking preferences, purchases, commissions, and other information required for better visitor experience or site statistics.&lt;/p&gt;
&lt;h2&gt;How It Works ?&lt;/h2&gt;
&lt;p&gt;Your server sends some data to the visitor&#39;s browser in the form of a cookie. The browser may accept the cookie. If it does, it is stored as a plain text record on the visitor&#39;s hard drive. Now, when the visitor arrives at another page on your site, the browser sends the same cookie to the server for retrieval. Once retrieved, your server knows/remembers what was stored earlier.&lt;/p&gt;
&lt;p&gt;Cookies are a plain text data record of 5 variable-length fields &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Expires&lt;/strong&gt;&amp;nbsp;&amp;minus; The date the cookie will expire. If this is blank, the cookie will expire when the visitor quits the browser.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Domain&lt;/strong&gt;&amp;nbsp;&amp;minus; The domain name of your site.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Path&lt;/strong&gt;&amp;nbsp;&amp;minus; The path to the directory or web page that set the cookie. This may be blank if you want to retrieve the cookie from any directory or page.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Secure&lt;/strong&gt;&amp;nbsp;&amp;minus; If this field contains the word &quot;secure&quot;, then the cookie may only be retrieved with a secure server. If this field is blank, no such restriction exists.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Name=Value&lt;/strong&gt;&amp;nbsp;&amp;minus; Cookies are set and retrieved in the form of key-value pairs&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Cookies were originally designed for CGI programming. The data contained in a cookie is automatically transmitted between the web browser and the web server, so CGI scripts on the server can read and write cookie values that are stored on the client.&lt;/p&gt;
&lt;p&gt;JavaScript can also manipulate cookies using the&amp;nbsp;&lt;strong&gt;cookie&lt;/strong&gt;&amp;nbsp;property of the&amp;nbsp;&lt;strong&gt;Document&lt;/strong&gt;object. JavaScript can read, create, modify, and delete the cookies that apply to the current web page.&lt;/p&gt;
&lt;h2&gt;Storing Cookies&lt;/h2&gt;
&lt;p&gt;The simplest way to create a cookie is to assign a string value to the document.cookie object, which looks like this.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;document.cookie = &quot;key1 = value1;key2 = value2;expires = date&quot;;
&lt;/pre&gt;
&lt;p&gt;Here the&amp;nbsp;&lt;strong&gt;expires&lt;/strong&gt;&amp;nbsp;attribute is optional. If you provide this attribute with a valid date or time, then the cookie will expire on a given date or time and thereafter, the cookies&#39; value will not be accessible.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&amp;nbsp;&amp;minus; Cookie values may not include semicolons, commas, or whitespace. For this reason, you may want to use the JavaScript&amp;nbsp;&lt;strong&gt;escape()&lt;/strong&gt;&amp;nbsp;function to encode the value before storing it in the cookie. If you do this, you will also have to use the corresponding&amp;nbsp;&lt;strong&gt;unescape()&lt;/strong&gt;&amp;nbsp;function when you read the cookie value.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Try the following. It sets a customer name in an input cookie.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/NhTewF&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;   
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;WriteCookie&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;myform&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;customer&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;value &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Enter some value!&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               cookievalue &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; escape&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;myform&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;customer&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;cookie &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;name=&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; cookievalue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Setting Cookies : &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;name=&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; cookievalue &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;form&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;myform&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;action&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         Enter name: &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;customer&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;button&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Set Cookie&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onclick&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;WriteCookie&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/javascript/src/write_cookie.htm&quot; width=&quot;600px&quot; height=&quot;70px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;Now your machine has a cookie called&amp;nbsp;&lt;strong&gt;name&lt;/strong&gt;. You can set multiple cookies using multiple key = value pairs separated by comma.&lt;/p&gt;
&lt;h2&gt;Reading Cookies&lt;/h2&gt;
&lt;p&gt;Reading a cookie is just as simple as writing one, because the value of the document.cookie object is the cookie. So you can use this string whenever you want to access the cookie. The document.cookie string will keep a list of name=value pairs separated by semicolons, where&amp;nbsp;&lt;strong&gt;name&lt;/strong&gt;&amp;nbsp;is the name of a cookie and value is its string value.&lt;/p&gt;
&lt;p&gt;You can use strings&#39;&amp;nbsp;&lt;strong&gt;split()&lt;/strong&gt;&amp;nbsp;function to break a string into key and values as follows &amp;minus;&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Try the following example to get all the cookies.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/3jrgga&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;   
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;ReadCookie&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; allcookies &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;cookie&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;All Cookies : &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; allcookies &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               
               &lt;span class=&quot;com&quot;&gt;// Get all the cookies pairs in an array&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               cookiearray &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; allcookies&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               
               &lt;span class=&quot;com&quot;&gt;// Now take key value pair out of this array&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; i&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; i&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;cookiearray&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; i&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;++)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; cookiearray&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;=&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;];&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  value &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; cookiearray&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;=&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;];&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Key is : &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot; and Value is : &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; value&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;     
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;form&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;myform&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;action&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; click the following button and see the result:&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;button&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Get Cookie&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onclick&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;ReadCookie&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&amp;nbsp;&amp;minus; Here&amp;nbsp;&lt;strong&gt;length&lt;/strong&gt;&amp;nbsp;is a method of&amp;nbsp;&lt;strong&gt;Array&lt;/strong&gt;&amp;nbsp;class which returns the length of an array. We will discuss Arrays in a separate chapter. By that time, please try to digest it.&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/javascript/src/reading_cookies.htm&quot; width=&quot;600px&quot; height=&quot;130px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&amp;nbsp;&amp;minus; There may be some other cookies already set on your machine. The above code will display all the cookies set on your machine.&lt;/p&gt;
&lt;h2&gt;Setting Cookies Expiry Date&lt;/h2&gt;
&lt;p&gt;You can extend the life of a cookie beyond the current browser session by setting an expiration date and saving the expiry date within the cookie. This can be done by setting the&amp;nbsp;&lt;strong&gt;&amp;lsquo;expires&amp;rsquo;&lt;/strong&gt;&amp;nbsp;attribute to a date and time.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Try the following example. It illustrates how to extend the expiry date of a cookie by 1 Month.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/pPp4ZY&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;   
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;WriteCookie&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; now &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Date&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               now&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;setMonth&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; now&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;getMonth&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               cookievalue &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; escape&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;myform&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;customer&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;cookie &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;name=&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; cookievalue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;cookie &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;expires=&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; now&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;toUTCString&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Setting Cookies : &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;name=&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; cookievalue &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;form&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;myform&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;action&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         Enter name: &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;customer&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;button&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Set Cookie&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onclick&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;WriteCookie&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/javascript/src/setting_cookies.htm&quot; width=&quot;600px&quot; height=&quot;70px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Deleting a Cookie&lt;/h2&gt;
&lt;p&gt;Sometimes you will want to delete a cookie so that subsequent attempts to read the cookie return nothing. To do this, you just need to set the expiry date to a time in the past.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Try the following example. It illustrates how to delete a cookie by setting its expiry date to one month behind the current date.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/pPp4ZY&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;   
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;WriteCookie&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; now &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Date&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               now&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;setMonth&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; now&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;getMonth&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               cookievalue &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; escape&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;myform&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;customer&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;cookie &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;name=&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; cookievalue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;cookie &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;expires=&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; now&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;toUTCString&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Setting Cookies : &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;name=&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; cookievalue &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
          &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;form&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;myform&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;action&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         Enter name: &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;customer&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;button&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Set Cookie&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onclick&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;WriteCookie&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/javascript/src/deleting_cookies.htm&quot; width=&quot;600px&quot; height=&quot;70px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;

&lt;h1&gt;HTML DOM&lt;/h1&gt;
&lt;p&gt;Every web page resides inside a browser window which can be considered as an object.&lt;/p&gt;
&lt;p&gt;A Document object represents the HTML document that is displayed in that window. The Document object has various properties that refer to other objects which allow access to and modification of document content.&lt;/p&gt;
&lt;p&gt;The way a document content is accessed and modified is called the&amp;nbsp;&lt;strong&gt;Document Object Model&lt;/strong&gt;, or&amp;nbsp;&lt;strong&gt;DOM&lt;/strong&gt;. The Objects are organized in a hierarchy. This hierarchical structure applies to the organization of objects in a Web document.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Window object&lt;/strong&gt;&amp;nbsp;&amp;minus; Top of the hierarchy. It is the outmost element of the object hierarchy.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Document object&lt;/strong&gt;&amp;nbsp;&amp;minus; Each HTML document that gets loaded into a window becomes a document object. The document contains the contents of the page.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Form object&lt;/strong&gt;&amp;nbsp;&amp;minus; Everything enclosed in the &amp;lt;form&amp;gt;...&amp;lt;/form&amp;gt; tags sets the form object.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Form control elements&lt;/strong&gt;&amp;nbsp;&amp;minus; The form object contains all the elements defined for that object such as text fields, buttons, radio buttons, and checkboxes.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here is a simple hierarchy of a few important objects &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/javascript/images/html-dom.jpg&quot; alt=&quot;HTML DOM&quot; /&gt;&lt;/p&gt;
&lt;p&gt;There are several DOMs in existence. The following sections explain each of these DOMs in detail and describe how you can use them to access and modify document content.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://www.tutorialspoint.com/javascript/javascript_legacy_dom.htm&quot;&gt;The Legacy DOM&lt;/a&gt;&amp;nbsp;&amp;minus; This is the model which was introduced in early versions of JavaScript language. It is well supported by all browsers, but allows access only to certain key portions of documents, such as forms, form elements, and images.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://www.tutorialspoint.com/javascript/javascript_w3c_dom.htm&quot;&gt;The W3C DOM&lt;/a&gt;&amp;nbsp;&amp;minus; This document object model allows access and modification of all document content and is standardized by the World Wide Web Consortium (W3C). This model is supported by almost all the modern browsers.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://www.tutorialspoint.com/javascript/javascript_ie4_dom.htm&quot;&gt;The IE4 DOM&lt;/a&gt;&amp;nbsp;&amp;minus; This document object model was introduced in Version 4 of Microsoft&#39;s Internet Explorer browser. IE 5 and later versions include support for most basic W3C DOM features.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;DOM compatibility&lt;/h2&gt;
&lt;p&gt;If you want to write a script with the flexibility to use either W3C DOM or IE 4 DOM depending on their availability, then you can use a capability-testing approach that first checks for the existence of a method or property to determine whether the browser has the capability you desire. For example &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;if (document.getElementById) {
   // If the W3C method exists, use it
} else if (document.all) {
   // If the all[] array exists, use it
} else {
   // Otherwise use the legacy DOM
}&lt;/pre&gt;

&lt;h1&gt;Error Handling&lt;/h1&gt;
&lt;p&gt;There are three types of errors in programming: (a) Syntax Errors, (b) Runtime Errors, and (c) Logical Errors.&lt;/p&gt;
&lt;h2&gt;Syntax Errors&lt;/h2&gt;
&lt;p&gt;Syntax errors, also called&amp;nbsp;&lt;strong&gt;parsing errors,&lt;/strong&gt;&amp;nbsp;occur at compile time in traditional programming languages and at interpret time in JavaScript.&lt;/p&gt;
&lt;p&gt;For example, the following line causes a syntax error because it is missing a closing parenthesis.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&amp;lt;script type = &quot;text/javascript&quot;&amp;gt;
   &amp;lt;!--
      window.print(;
   //--&amp;gt;
&amp;lt;/script&amp;gt;
&lt;/pre&gt;
&lt;p&gt;When a syntax error occurs in JavaScript, only the code contained within the same thread as the syntax error is affected and the rest of the code in other threads gets executed assuming nothing in them depends on the code containing the error.&lt;/p&gt;
&lt;h2&gt;Runtime Errors&lt;/h2&gt;
&lt;p&gt;Runtime errors, also called&amp;nbsp;&lt;strong&gt;exceptions,&lt;/strong&gt;&amp;nbsp;occur during execution (after compilation/interpretation).&lt;/p&gt;
&lt;p&gt;For example, the following line causes a runtime error because here the syntax is correct, but at runtime, it is trying to call a method that does not exist.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&amp;lt;script type = &quot;text/javascript&quot;&amp;gt;
   &amp;lt;!--
      window.printme();
   //--&amp;gt;
&amp;lt;/script&amp;gt;
&lt;/pre&gt;
&lt;p&gt;Exceptions also affect the thread in which they occur, allowing other JavaScript threads to continue normal execution.&lt;/p&gt;
&lt;h2&gt;Logical Errors&lt;/h2&gt;
&lt;p&gt;Logic errors can be the most difficult type of errors to track down. These errors are not the result of a syntax or runtime error. Instead, they occur when you make a mistake in the logic that drives your script and you do not get the result you expected.&lt;/p&gt;
&lt;p&gt;You cannot catch those errors, because it depends on your business requirement what type of logic you want to put in your program.&lt;/p&gt;
&lt;h2&gt;The try...catch...finally Statement&lt;/h2&gt;
&lt;p&gt;The latest versions of JavaScript added exception handling capabilities. JavaScript implements the&amp;nbsp;&lt;strong&gt;try...catch...finally&lt;/strong&gt;&amp;nbsp;construct as well as the&amp;nbsp;&lt;strong&gt;throw&lt;/strong&gt;&amp;nbsp;operator to handle exceptions.&lt;/p&gt;
&lt;p&gt;You can&amp;nbsp;&lt;strong&gt;catch&lt;/strong&gt;&amp;nbsp;programmer-generated and&amp;nbsp;&lt;strong&gt;runtime&lt;/strong&gt;&amp;nbsp;exceptions, but you cannot&amp;nbsp;&lt;strong&gt;catch&lt;/strong&gt;JavaScript syntax errors.&lt;/p&gt;
&lt;p&gt;Here is the&amp;nbsp;&lt;strong&gt;try...catch...finally&lt;/strong&gt;&amp;nbsp;block syntax &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;// Code to run&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;]&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt; 
      
      &lt;span class=&quot;kwd&quot;&gt;catch&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; e &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;// Code to run if an exception occurs&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;]&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
      
      &lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; finally &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;// Code that is always executed regardless of &lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;// an exception occurring&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;}]&lt;/span&gt;
   &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;try&lt;/strong&gt;&amp;nbsp;block must be followed by either exactly one&amp;nbsp;&lt;strong&gt;catch&lt;/strong&gt;&amp;nbsp;block or one&amp;nbsp;&lt;strong&gt;finally&lt;/strong&gt;&amp;nbsp;block (or one of both). When an exception occurs in the&amp;nbsp;&lt;strong&gt;try&lt;/strong&gt;&amp;nbsp;block, the exception is placed in&amp;nbsp;&lt;strong&gt;e&lt;/strong&gt;&amp;nbsp;and the&amp;nbsp;&lt;strong&gt;catch&lt;/strong&gt;&amp;nbsp;block is executed. The optional&amp;nbsp;&lt;strong&gt;finally&lt;/strong&gt;&amp;nbsp;block executes unconditionally after try/catch.&lt;/p&gt;
&lt;h3&gt;Examples&lt;/h3&gt;
&lt;p&gt;Here is an example where we are trying to call a non-existing function which in turn is raising an exception. Let us see how it behaves without&amp;nbsp;&lt;strong&gt;try...catch&lt;/strong&gt;&amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/zvPSag&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myFunc&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Value of variable a is : &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click the following to see the result:&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;form&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;button&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Click Me&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onclick&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;myFunc&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/javascript/src/error_handling.htm&quot; width=&quot;600px&quot; height=&quot;90px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;Now let us try to catch this exception using&amp;nbsp;&lt;strong&gt;try...catch&lt;/strong&gt;&amp;nbsp;and display a user-friendly message. You can also suppress this message, if you want to hide this error from a user.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/UnaRU3&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myFunc&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Value of variable a is : &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt; 
               &lt;span class=&quot;kwd&quot;&gt;catch&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; e &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Error: &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;description &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click the following to see the result:&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;form&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;button&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Click Me&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onclick&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;myFunc&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;
      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/javascript/src/error_handling2.htm&quot; width=&quot;600px&quot; height=&quot;90px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;You can use&amp;nbsp;&lt;strong&gt;finally&lt;/strong&gt;&amp;nbsp;block which will always execute unconditionally after the try/catch. Here is an example.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/nwZsBT&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myFunc&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
               
               &lt;span class=&quot;kwd&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Value of variable a is : &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;catch&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; e &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Error: &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;description &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               finally &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Finally block will always execute!&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click the following to see the result:&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;form&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;button&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Click Me&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onclick&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;myFunc&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;
      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/javascript/src/error_handling3.htm&quot; width=&quot;600px&quot; height=&quot;90px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;The throw Statement&lt;/h2&gt;
&lt;p&gt;You can use&amp;nbsp;&lt;strong&gt;throw&lt;/strong&gt;&amp;nbsp;statement to raise your built-in exceptions or your customized exceptions. Later these exceptions can be captured and you can take an appropriate action.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;The following example demonstrates how to use a&amp;nbsp;&lt;strong&gt;throw&lt;/strong&gt;&amp;nbsp;statement.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/sPAG21&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myFunc&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
               
               &lt;span class=&quot;kwd&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                  &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;throw&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Divide by zero error.&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt; 
                  &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
                     &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; c &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
                  &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;catch&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; e &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Error: &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; e &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click the following to see the result:&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;form&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;button&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Click Me&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onclick&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;myFunc&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;
      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/javascript/src/throw_statement.htm&quot; width=&quot;600px&quot; height=&quot;90px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;You can raise an exception in one function using a string, integer, Boolean, or an object and then you can capture that exception either in the same function as we did above, or in another function using a&amp;nbsp;&lt;strong&gt;try...catch&lt;/strong&gt;&amp;nbsp;block.&lt;/p&gt;
&lt;h2&gt;The onerror() Method&lt;/h2&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;onerror&lt;/strong&gt;&amp;nbsp;event handler was the first feature to facilitate error handling in JavaScript. The&amp;nbsp;&lt;strong&gt;error&lt;/strong&gt;&amp;nbsp;event is fired on the window object whenever an exception occurs on the page.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/SWbdYM&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            window&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;onerror &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;An error occurred.&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click the following to see the result:&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;form&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;button&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Click Me&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onclick&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;myFunc&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;
      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/javascript/src/onerror.htm&quot; width=&quot;600px&quot; height=&quot;90px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;onerror&lt;/strong&gt;&amp;nbsp;event handler provides three pieces of information to identify the exact nature of the error &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Error message&lt;/strong&gt;&amp;nbsp;&amp;minus; The same message that the browser would display for the given error&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;URL&lt;/strong&gt;&amp;nbsp;&amp;minus; The file in which the error occurred&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Line number&lt;/strong&gt;&amp;minus; The line number in the given URL that caused the error&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here is the example to show how to extract this information.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/axqshk&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
   
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            window&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;onerror &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;msg&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; line&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Message : &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; msg &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;url : &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Line number : &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; line &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click the following to see the result:&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;form&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;button&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Click Me&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onclick&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;myFunc&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;
      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/javascript/src/error_handling4.htm&quot; width=&quot;600px&quot; height=&quot;90px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;You can display extracted information in whatever way you think it is better.&lt;/p&gt;
&lt;p&gt;You can use an&amp;nbsp;&lt;strong&gt;onerror&lt;/strong&gt;&amp;nbsp;method, as shown below, to display an error message in case there is any problem in loading an image.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;myimage.gif&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onerror&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;An error occurred loading the image.&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;You can use&amp;nbsp;&lt;strong&gt;onerror&lt;/strong&gt;&amp;nbsp;with many HTML tags to display appropriate messages in case of errors.&lt;/p&gt;

&lt;h1&gt;Animation&lt;/h1&gt;
&lt;p&gt;You can use JavaScript to create a complex animation having, but not limited to, the following elements &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;Fireworks&lt;/li&gt;
&lt;li&gt;Fade Effect&lt;/li&gt;
&lt;li&gt;Roll-in or Roll-out&lt;/li&gt;
&lt;li&gt;Page-in or Page-out&lt;/li&gt;
&lt;li&gt;Object movements&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You might be interested in existing JavaScript based animation library:&amp;nbsp;&lt;a href=&quot;https://www.tutorialspoint.com/script.aculo.us/scriptaculous_effects.htm&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;Script.Aculo.us&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This tutorial provides a basic understanding of how to use JavaScript to create an animation.&lt;/p&gt;
&lt;p&gt;JavaScript can be used to move a number of DOM elements (&amp;lt;img /&amp;gt;, &amp;lt;div&amp;gt; or any other HTML element) around the page according to some sort of pattern determined by a logical equation or function.&lt;/p&gt;
&lt;p&gt;JavaScript provides the following two functions to be frequently used in animation programs.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;setTimeout( function, duration)&lt;/strong&gt;&amp;nbsp;&amp;minus; This function calls&amp;nbsp;&lt;strong&gt;function&lt;/strong&gt;&amp;nbsp;after&amp;nbsp;&lt;strong&gt;duration&lt;/strong&gt;milliseconds from now.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;setInterval(function, duration)&lt;/strong&gt;&amp;nbsp;&amp;minus; This function calls&amp;nbsp;&lt;strong&gt;function&lt;/strong&gt;&amp;nbsp;after every&amp;nbsp;&lt;strong&gt;duration&lt;/strong&gt;&amp;nbsp;milliseconds.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;clearTimeout(setTimeout_variable)&lt;/strong&gt;&amp;nbsp;&amp;minus; This function calls clears any timer set by the setTimeout() functions.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;JavaScript can also set a number of attributes of a DOM object including its position on the screen. You can set&amp;nbsp;&lt;em&gt;top&lt;/em&gt;&amp;nbsp;and left attribute of an object to position it anywhere on the screen. Here is its syntax.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;// Set distance from left edge of the screen.
object.style.left = distance in pixels or points; 

or

// Set distance from top edge of the screen.
object.style.top = distance in pixels or points; 
&lt;/pre&gt;
&lt;h2&gt;Manual Animation&lt;/h2&gt;
&lt;p&gt;So let&#39;s implement one simple animation using DOM object properties and JavaScript functions as follows. The following list contains different DOM methods.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;We are using the JavaScript function&amp;nbsp;&lt;strong&gt;getElementById()&lt;/strong&gt;&amp;nbsp;to get a DOM object and then assigning it to a global variable&amp;nbsp;&lt;strong&gt;imgObj&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;We have defined an initialization function&amp;nbsp;&lt;strong&gt;init()&lt;/strong&gt;&amp;nbsp;to initialize&amp;nbsp;&lt;strong&gt;imgObj&lt;/strong&gt;&amp;nbsp;where we have set its&amp;nbsp;&lt;strong&gt;position&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;left&lt;/strong&gt;&amp;nbsp;attributes.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;We are calling initialization function at the time of window load.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Finally, we are calling&amp;nbsp;&lt;strong&gt;moveRight()&lt;/strong&gt;&amp;nbsp;function to increase the left distance by 10 pixels. You could also set it to a negative value to move it to the left side.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Try the following example.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/UbmRv3&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;JavaScript Animation&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; imgObj &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
            
            &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; init&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               imgObj &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;getElementById&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;myImage&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               imgObj&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;relative&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
               imgObj&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;left &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;0px&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt; 
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; moveRight&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               imgObj&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;left &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; parseInt&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;imgObj&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;10&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;px&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            
            window&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;onload &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; init&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;   
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;form&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;myImage&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/images/html.gif&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click button below to move the image to right&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;button&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Click Me&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onclick&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;moveRight&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/javascript/src/animation.htm&quot; width=&quot;600px&quot; height=&quot;250px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Automated Animation&lt;/h2&gt;
&lt;p&gt;In the above example, we saw how an image moves to right with every click. We can automate this process by using the JavaScript function&amp;nbsp;&lt;strong&gt;setTimeout()&lt;/strong&gt;&amp;nbsp;as follows &amp;minus;&lt;/p&gt;
&lt;p&gt;Here we have added more methods. So let&#39;s see what is new here &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;moveRight()&lt;/strong&gt;&amp;nbsp;function is calling&amp;nbsp;&lt;strong&gt;setTimeout()&lt;/strong&gt;&amp;nbsp;function to set the position of&amp;nbsp;&lt;em&gt;imgObj&lt;/em&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;We have added a new function&amp;nbsp;&lt;strong&gt;stop()&lt;/strong&gt;&amp;nbsp;to clear the timer set by&amp;nbsp;&lt;strong&gt;setTimeout()&lt;/strong&gt;function and to set the object at its initial position.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Try the following example code.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/Oj2F1A&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;JavaScript Animation&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; imgObj &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; animate &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
            
            &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; init&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               imgObj &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;getElementById&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;myImage&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               imgObj&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;relative&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
               imgObj&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;left &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;0px&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt; 
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; moveRight&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               imgObj&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;left &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; parseInt&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;imgObj&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;10&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;px&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               animate &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; setTimeout&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;moveRight&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;    &lt;span class=&quot;com&quot;&gt;// call moveRight in 20msec&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; stop&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               clearTimeout&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;animate&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               imgObj&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;left &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;0px&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt; 
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            
            window&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;onload &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; init&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;   
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;form&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;myImage&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/images/html.gif&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click the buttons below to handle animation&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;button&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Start&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onclick&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;moveRight&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;button&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Stop&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onclick&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;stop&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/javascript/src/animation2.htm&quot; width=&quot;600px&quot; height=&quot;250px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Rollover with a Mouse Event&lt;/h2&gt;
&lt;p&gt;Here is a simple example showing image rollover with a mouse event.&lt;/p&gt;
&lt;p&gt;Let&#39;s see what we are using in the following example &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;At the time of loading this page, the &amp;lsquo;if&amp;rsquo; statement checks for the existence of the image object. If the image object is unavailable, this block will not be executed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;Image()&lt;/strong&gt;&amp;nbsp;constructor creates and preloads a new image object called&amp;nbsp;&lt;strong&gt;image1&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The src property is assigned the name of the external image file called /images/html.gif.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Similarly, we have created&amp;nbsp;&lt;strong&gt;image2&lt;/strong&gt;&amp;nbsp;object and assigned /images/http.gif in this object.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The # (hash mark) disables the link so that the browser does not try to go to a URL when clicked. This link is an image.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;onMouseOver&lt;/strong&gt;&amp;nbsp;event handler is triggered when the user&#39;s mouse moves onto the link, and the&amp;nbsp;&lt;strong&gt;onMouseOut&lt;/strong&gt;&amp;nbsp;event handler is triggered when the user&#39;s mouse moves away from the link (image).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;When the mouse moves over the image, the HTTP image changes from the first image to the second one. When the mouse is moved away from the image, the original image is displayed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;When the mouse is moved away from the link, the initial image html.gif will reappear on the screen.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/w17vaD&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Rollover with a Mouse Events&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;images&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; image1 &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Image&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;     &lt;span class=&quot;com&quot;&gt;// Preload an image&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               image1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;src &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;/images/html.gif&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
               &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; image2 &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Image&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;     &lt;span class=&quot;com&quot;&gt;// Preload second image&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               image2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;src &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;/images/http.gif&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Move your mouse over the image to see the result&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;#&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onMouseOver&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;myImage&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;src &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; image2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;
         &lt;span class=&quot;atn&quot;&gt;onMouseOut&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;myImage&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;src &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; image1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;myImage&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/images/html.gif&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/javascript/src/animation3.htm&quot; width=&quot;600px&quot; height=&quot;250px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;

&lt;h1&gt;Browser&lt;/h1&gt;
&lt;p&gt;It is important to understand the differences between different browsers in order to handle each in the way it is expected. So it is important to know which browser your web page is running in.&lt;/p&gt;
&lt;p&gt;To get information about the browser your webpage is currently running in, use the built-in&amp;nbsp;&lt;strong&gt;navigator&lt;/strong&gt;&amp;nbsp;object.&lt;/p&gt;
&lt;h2&gt;Navigator Properties&lt;/h2&gt;
&lt;p&gt;There are several Navigator related properties that you can use in your Web page. The following is a list of the names and descriptions of each.&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Sr.No.&lt;/th&gt;
&lt;th&gt;Property &amp;amp; Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;1&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;appCodeName&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This property is a string that contains the code name of the browser, Netscape for Netscape and Microsoft Internet Explorer for Internet Explorer.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;2&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;appVersion&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This property is a string that contains the version of the browser as well as other useful information such as its language and compatibility.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;3&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;language&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This property contains the two-letter abbreviation for the language that is used by the browser. Netscape only.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;4&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;mimTypes[]&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This property is an array that contains all MIME types supported by the client. Netscape only.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;5&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;platform[]&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This property is a string that contains the platform for which the browser was compiled.&quot;Win32&quot; for 32-bit Windows operating systems&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;6&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;plugins[]&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This property is an array containing all the plug-ins that have been installed on the client. Netscape only.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;7&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;userAgent[]&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This property is a string that contains the code name and version of the browser. This value is sent to the originating server to identify the client.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Navigator Methods&lt;/h2&gt;
&lt;p&gt;There are several Navigator-specific methods. Here is a list of their names and descriptions.&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Sr.No.&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;1&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;javaEnabled()&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This method determines if JavaScript is enabled in the client. If JavaScript is enabled, this method returns true; otherwise, it returns false.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;2&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;plugings.refresh&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This method makes newly installed plug-ins available and populates the plugins array with all new plug-in names. Netscape only.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;3&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;preference(name,value)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This method allows a signed script to get and set some Netscape preferences. If the second parameter is omitted, this method will return the value of the specified preference; otherwise, it sets the value. Netscape only.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;4&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;taintEnabled()&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This method returns true if data tainting is enabled; false otherwise.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Browser Detection&lt;/h2&gt;
&lt;p&gt;There is a simple JavaScript which can be used to find out the name of a browser and then accordingly an HTML page can be served to the user.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/j6gTQQ&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Browser Detection Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; userAgent   &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; navigator&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;userAgent&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; opera       &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;userAgent&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;indexOf&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Opera&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; ie          &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;userAgent&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;indexOf&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;MSIE&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; gecko       &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;userAgent&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;indexOf&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Gecko&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; netscape    &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;userAgent&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;indexOf&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Mozilla&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; version     &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; navigator&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;appVersion&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
            
            &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;opera&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Opera based browser&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;com&quot;&gt;// Keep your opera specific URL here.&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;gecko&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Mozilla based browser&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;com&quot;&gt;// Keep your gecko specific URL here.&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ie&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;IE based browser&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;com&quot;&gt;// Keep your IE specific URL here.&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;netscape&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Netscape based browser&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
               &lt;span class=&quot;com&quot;&gt;// Keep your Netscape specific URL here.&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Unknown browser&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
            
            &lt;span class=&quot;com&quot;&gt;// You can include version to along with any above condition.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;br /&amp;gt; Browser version info : &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; version &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Output&lt;/h3&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/javascript/src/browsers_handling.htm&quot; width=&quot;600px&quot; height=&quot;90px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;script&gt;mbtTOC();&lt;/script&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;http://feeds.feedburner.com/PostLinkSharing&lt;/div&gt;</description><link>https://plinksharing.blogspot.com/2021/02/javascript-tutorials.html</link><author>noreply@blogger.com (Arakkha Sênâ)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1955839799848409424.post-4328095832128849241</guid><pubDate>Sat, 13 Feb 2021 00:05:00 +0000</pubDate><atom:updated>2021-02-12T16:05:21.377-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Html</category><category domain="http://www.blogger.com/atom/ns#">Web Programs</category><title>HTML Learn</title><description>&lt;div class=&quot;mbtTOC&quot;&gt;
    &lt;button onclick=&quot;mbtToggle()&quot;&gt;Contents&lt;/button&gt;
    &lt;ol id=&quot;mbtTOC&quot;&gt;&lt;/ol&gt;
    &lt;/div&gt;
&lt;h1&gt;Introduction&lt;/h1&gt;
&lt;p&gt;HTML stands for&amp;nbsp;&lt;strong&gt;&lt;u&gt;H&lt;/u&gt;&lt;/strong&gt;yper&lt;strong&gt;&lt;u&gt;t&lt;/u&gt;&lt;/strong&gt;ext&amp;nbsp;&lt;strong&gt;&lt;u&gt;M&lt;/u&gt;&lt;/strong&gt;arkup&amp;nbsp;&lt;strong&gt;&lt;u&gt;L&lt;/u&gt;&lt;/strong&gt;anguage, and it is the most widely used language to write Web Pages.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Hypertext&lt;/strong&gt;&amp;nbsp;refers to the way in which Web pages (HTML documents) are linked together. Thus, the link available on a webpage is called Hypertext.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;As its name suggests, HTML is a&amp;nbsp;&lt;strong&gt;Markup Language&lt;/strong&gt;&amp;nbsp;which means you use HTML to simply &quot;mark-up&quot; a text document with tags that tell a Web browser how to structure it to display.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Originally, HTML was developed with the intent of defining the structure of documents like headings, paragraphs, lists, and so forth to facilitate the sharing of scientific information between researchers.&lt;/p&gt;
&lt;p&gt;Now, HTML is being widely used to format web pages with the help of different tags available in HTML language.&lt;/p&gt;
&lt;h2&gt;Basic HTML Document&lt;/h2&gt;
&lt;p&gt;In its simplest form, following is an example of an HTML document &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/tryL9g&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is document title&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is a heading&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Document content goes here.....&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/basic_html_document.htm&quot; width=&quot;600px&quot; height=&quot;150px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;HTML Tags&lt;/h2&gt;
&lt;p&gt;As told earlier, HTML is a markup language and makes use of various tags to format the content. These tags are enclosed within angle braces&amp;nbsp;&lt;strong&gt;&amp;lt;Tag Name&amp;gt;&lt;/strong&gt;. Except few tags, most of the tags have their corresponding closing tags. For example,&amp;nbsp;&lt;strong&gt;&amp;lt;html&amp;gt;&lt;/strong&gt;&amp;nbsp;has its closing tag&amp;nbsp;&lt;strong&gt;&amp;lt;/html&amp;gt;&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;&amp;lt;body&amp;gt;&lt;/strong&gt;&amp;nbsp;tag has its closing tag&amp;nbsp;&lt;strong&gt;&amp;lt;/body&amp;gt;&lt;/strong&gt;&amp;nbsp;tag etc.&lt;/p&gt;
&lt;p&gt;Above example of HTML document uses the following tags &amp;minus;&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Sr.No&lt;/th&gt;
&lt;th&gt;Tag &amp;amp; Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;1&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;&amp;lt;!DOCTYPE...&amp;gt;&lt;/strong&gt;
&lt;p&gt;This tag defines the document type and HTML version.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;2&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;&amp;lt;html&amp;gt;&lt;/strong&gt;
&lt;p&gt;This tag encloses the complete HTML document and mainly comprises of document header which is represented by &amp;lt;head&amp;gt;...&amp;lt;/head&amp;gt; and document body which is represented by &amp;lt;body&amp;gt;...&amp;lt;/body&amp;gt; tags.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;3&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;&amp;lt;head&amp;gt;&lt;/strong&gt;
&lt;p&gt;This tag represents the document&#39;s header which can keep other HTML tags like &amp;lt;title&amp;gt;, &amp;lt;link&amp;gt; etc.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;4&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;&amp;lt;title&amp;gt;&lt;/strong&gt;
&lt;p&gt;The &amp;lt;title&amp;gt; tag is used inside the &amp;lt;head&amp;gt; tag to mention the document title.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;5&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;&amp;lt;body&amp;gt;&lt;/strong&gt;
&lt;p&gt;This tag represents the document&#39;s body which keeps other HTML tags like &amp;lt;h1&amp;gt;, &amp;lt;div&amp;gt;, &amp;lt;p&amp;gt; etc.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;6&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;&amp;lt;h1&amp;gt;&lt;/strong&gt;
&lt;p&gt;This tag represents the heading.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;7&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;&amp;lt;p&amp;gt;&lt;/strong&gt;
&lt;p&gt;This tag represents a paragraph.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;To learn HTML, you will need to study various tags and understand how they behave, while formatting a textual document. Learning HTML is simple as users have to learn the usage of different tags in order to format the text or images to make a beautiful webpage.&lt;/p&gt;
&lt;p&gt;World Wide Web Consortium (W3C) recommends to use lowercase tags starting from HTML 4.&lt;/p&gt;
&lt;h2&gt;HTML Document Structure&lt;/h2&gt;
&lt;p&gt;A typical HTML document will have the following structure &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      Document header related tags
   &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      Document body related tags
   &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
   
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We will study all the header and body tags in subsequent chapters, but for now let&#39;s see what is document declaration tag.&lt;/p&gt;
&lt;h2&gt;The &amp;lt;!DOCTYPE&amp;gt; Declaration&lt;/h2&gt;
&lt;p&gt;The &amp;lt;!DOCTYPE&amp;gt; declaration tag is used by the web browser to understand the version of the HTML used in the document. Current version of HTML is 5 and it makes use of the following declaration &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;There are many other declaration types which can be used in HTML document depending on what version of HTML is being used. We will see more details on this while discussing &amp;lt;!DOCTYPE...&amp;gt; tag along with other HTML tags.&lt;/p&gt;

&lt;h1&gt;Basic Tags&lt;/h1&gt;
&lt;h2&gt;Heading Tags&lt;/h2&gt;
&lt;p&gt;Any document starts with a heading. You can use different sizes for your headings. HTML also has six levels of headings, which use the elements&amp;nbsp;&lt;strong&gt;&amp;lt;h1&amp;gt;, &amp;lt;h2&amp;gt;, &amp;lt;h3&amp;gt;, &amp;lt;h4&amp;gt;, &amp;lt;h5&amp;gt;,&lt;/strong&gt;and&amp;nbsp;&lt;strong&gt;&amp;lt;h6&amp;gt;&lt;/strong&gt;. While displaying any heading, browser adds one line before and one line after that heading.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/Oevfe8&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Heading Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is heading 1&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is heading 2&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is heading 3&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;h4&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is heading 4&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h4&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;h5&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is heading 5&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h5&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;h6&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is heading 6&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h6&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/heading_tag.htm&quot; width=&quot;600px&quot; height=&quot;300px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Paragraph Tag&lt;/h2&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;&amp;lt;p&amp;gt;&lt;/strong&gt;&amp;nbsp;tag offers a way to structure your text into different paragraphs. Each paragraph of text should go in between an opening &amp;lt;p&amp;gt; and a closing &amp;lt;/p&amp;gt; tag as shown below in the example &amp;minus;&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/Uo5jZe&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Paragraph Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Here is a first paragraph of text.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Here is a second paragraph of text.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Here is a third paragraph of text.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/paragraph_tag.htm&quot; width=&quot;600px&quot; height=&quot;150px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Line Break Tag&lt;/h2&gt;
&lt;p&gt;Whenever you use the&amp;nbsp;&lt;strong&gt;&amp;lt;br /&amp;gt;&lt;/strong&gt;&amp;nbsp;element, anything following it starts from the next line. This tag is an example of an&amp;nbsp;&lt;strong&gt;empty&lt;/strong&gt;&amp;nbsp;element, where you do not need opening and closing tags, as there is nothing to go in between them.&lt;/p&gt;
&lt;p&gt;The &amp;lt;br /&amp;gt; tag has a space between the characters&amp;nbsp;&lt;strong&gt;br&lt;/strong&gt;&amp;nbsp;and the forward slash. If you omit this space, older browsers will have trouble rendering the line break, while if you miss the forward slash character and just use &amp;lt;br&amp;gt; it is not valid in XHTML.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/aWg5PG&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Line Break  Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Hello&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;br&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         You delivered your assignment ontime.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;br&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         Thanks&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;br&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         Mahnaz&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/line_break_tag.htm&quot; width=&quot;600px&quot; height=&quot;150px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Centering Content&lt;/h2&gt;
&lt;p&gt;You can use&amp;nbsp;&lt;strong&gt;&amp;lt;center&amp;gt;&lt;/strong&gt;&amp;nbsp;tag to put any content in the center of the page or any table cell.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/mVrRPS&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Centring Content Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This text is not in the center.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;center&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This text is in the center.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/center&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/centering_content.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Horizontal Lines&lt;/h2&gt;
&lt;p&gt;Horizontal lines are used to visually break-up sections of a document. The&amp;nbsp;&lt;strong&gt;&amp;lt;hr&amp;gt;&lt;/strong&gt;&amp;nbsp;tag creates a line from the current position in the document to the right margin and breaks the line accordingly.&lt;/p&gt;
&lt;p&gt;For example, you may want to give a line between two paragraphs as in the given example below &amp;minus;&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/4iAnXc&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Horizontal Line Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is paragraph one and should be on top&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;hr&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is paragraph two and should be at bottom&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/horizontal_lines.htm&quot; width=&quot;600px&quot; height=&quot;150px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;Again&amp;nbsp;&lt;strong&gt;&amp;lt;hr /&amp;gt;&lt;/strong&gt;&amp;nbsp;tag is an example of the&amp;nbsp;&lt;strong&gt;empty&lt;/strong&gt;&amp;nbsp;element, where you do not need opening and closing tags, as there is nothing to go in between them.&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;&amp;lt;hr /&amp;gt;&lt;/strong&gt;&amp;nbsp;element has a space between the characters&amp;nbsp;&lt;strong&gt;hr&lt;/strong&gt;&amp;nbsp;and the forward slash. If you omit this space, older browsers will have trouble rendering the horizontal line, while if you miss the forward slash character and just use&amp;nbsp;&lt;strong&gt;&amp;lt;hr&amp;gt;&lt;/strong&gt;&amp;nbsp;it is not valid in XHTML&lt;/p&gt;
&lt;h2&gt;Preserve Formatting&lt;/h2&gt;
&lt;p&gt;Sometimes, you want your text to follow the exact format of how it is written in the HTML document. In these cases, you can use the preformatted tag&amp;nbsp;&lt;strong&gt;&amp;lt;pre&amp;gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Any text between the opening&amp;nbsp;&lt;strong&gt;&amp;lt;pre&amp;gt;&lt;/strong&gt;&amp;nbsp;tag and the closing&amp;nbsp;&lt;strong&gt;&amp;lt;/pre&amp;gt;&lt;/strong&gt;&amp;nbsp;tag will preserve the formatting of the source document.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/e3k3sG&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Preserve Formatting Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;pre&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         function testFunction( strText ){
            alert (strText)
         }
      &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/pre&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/preserve_formatting.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;Try using the same code without keeping it inside&amp;nbsp;&lt;strong&gt;&amp;lt;pre&amp;gt;...&amp;lt;/pre&amp;gt;&lt;/strong&gt;&amp;nbsp;tags&lt;/p&gt;
&lt;h2&gt;Nonbreaking Spaces&lt;/h2&gt;
&lt;p&gt;Suppose you want to use the phrase &quot;12 Angry Men.&quot; Here, you would not want a browser to split the &quot;12, Angry&quot; and &quot;Men&quot; across two lines &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;An example of this technique appears in the movie &quot;12 Angry Men.&quot;
&lt;/pre&gt;
&lt;p&gt;In cases, where you do not want the client browser to break text, you should use a nonbreaking space entity&amp;nbsp;&lt;strong&gt;&amp;amp;nbsp;&lt;/strong&gt;&amp;nbsp;instead of a normal space. For example, when coding the &quot;12 Angry Men&quot; in a paragraph, you should use something similar to the following code &amp;minus;&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/OhhfWR&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Nonbreaking Spaces Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;An example of this technique appears in the movie &quot;12&amp;amp;nbsp;Angry&amp;amp;nbsp;Men.&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/nonbreaking_spaces.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;

&lt;h1&gt;Elements&lt;/h1&gt;
&lt;p&gt;An&amp;nbsp;&lt;strong&gt;HTML element&lt;/strong&gt;&amp;nbsp;is defined by a starting tag. If the element contains other content, it ends with a closing tag, where the element name is preceded by a forward slash as shown below with few tags &amp;minus;&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Start Tag&lt;/th&gt;
&lt;th&gt;Content&lt;/th&gt;
&lt;th&gt;End Tag&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;lt;p&amp;gt;&lt;/td&gt;
&lt;td&gt;This is paragraph content.&lt;/td&gt;
&lt;td&gt;&amp;lt;/p&amp;gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;lt;h1&amp;gt;&lt;/td&gt;
&lt;td&gt;This is heading content.&lt;/td&gt;
&lt;td&gt;&amp;lt;/h1&amp;gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;lt;div&amp;gt;&lt;/td&gt;
&lt;td&gt;This is division content.&lt;/td&gt;
&lt;td&gt;&amp;lt;/div&amp;gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;lt;br /&amp;gt;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;So here&amp;nbsp;&lt;strong&gt;&amp;lt;p&amp;gt;....&amp;lt;/p&amp;gt;&lt;/strong&gt;&amp;nbsp;is an HTML element,&amp;nbsp;&lt;strong&gt;&amp;lt;h1&amp;gt;...&amp;lt;/h1&amp;gt;&lt;/strong&gt;&amp;nbsp;is another HTML element. There are some HTML elements which don&#39;t need to be closed, such as&amp;nbsp;&lt;strong&gt;&amp;lt;img.../&amp;gt;&lt;/strong&gt;,&amp;nbsp;&lt;strong&gt;&amp;lt;hr /&amp;gt;&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;&amp;lt;br /&amp;gt;&lt;/strong&gt;&amp;nbsp;elements. These are known as&amp;nbsp;&lt;strong&gt;void elements&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;HTML documents consists of a tree of these elements and they specify how HTML documents should be built, and what kind of content should be placed in what part of an HTML document.&lt;/p&gt;
&lt;h2&gt;HTML Tag vs. Element&lt;/h2&gt;
&lt;p&gt;An HTML element is defined by a&amp;nbsp;&lt;em&gt;starting tag&lt;/em&gt;. If the element contains other content, it ends with a&amp;nbsp;&lt;em&gt;closing tag&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;For example,&amp;nbsp;&lt;strong&gt;&amp;lt;p&amp;gt;&lt;/strong&gt;&amp;nbsp;is starting tag of a paragraph and&amp;nbsp;&lt;strong&gt;&amp;lt;/p&amp;gt;&lt;/strong&gt;&amp;nbsp;is closing tag of the same paragraph but&amp;nbsp;&lt;strong&gt;&amp;lt;p&amp;gt;This is paragraph&amp;lt;/p&amp;gt;&lt;/strong&gt;&amp;nbsp;is a paragraph element.&lt;/p&gt;
&lt;h2&gt;Nested HTML Elements&lt;/h2&gt;
&lt;p&gt;It is very much allowed to keep one HTML element inside another HTML element &amp;minus;&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/RWo6kx&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Nested Elements Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;i&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;italic&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/i&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; heading&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;u&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;underlined&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/u&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; paragraph&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will display the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/nested_html_elements.htm&quot; width=&quot;600px&quot; height=&quot;150px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;

&lt;h1&gt;Attributes&lt;/h1&gt;
&lt;p&gt;We have seen few HTML tags and their usage like heading tags&amp;nbsp;&lt;strong&gt;&amp;lt;h1&amp;gt;, &amp;lt;h2&amp;gt;,&lt;/strong&gt;&amp;nbsp;paragraph tag&amp;nbsp;&lt;strong&gt;&amp;lt;p&amp;gt;&lt;/strong&gt;&amp;nbsp;and other tags. We used them so far in their simplest form, but most of the HTML tags can also have attributes, which are extra bits of information.&lt;/p&gt;
&lt;p&gt;An attribute is used to define the characteristics of an HTML element and is placed inside the element&#39;s opening tag. All attributes are made up of two parts &amp;minus; a&amp;nbsp;&lt;strong&gt;name&lt;/strong&gt;&amp;nbsp;and a&amp;nbsp;&lt;strong&gt;value&lt;/strong&gt;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;name&lt;/strong&gt;&amp;nbsp;is the property you want to set. For example, the paragraph&amp;nbsp;&lt;strong&gt;&amp;lt;p&amp;gt;&lt;/strong&gt;element in the example carries an attribute whose name is&amp;nbsp;&lt;strong&gt;align&lt;/strong&gt;, which you can use to indicate the alignment of paragraph on the page.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;value&lt;/strong&gt;&amp;nbsp;is what you want the value of the property to be set and always put within quotations. The below example shows three possible values of align attribute:&amp;nbsp;&lt;strong&gt;left, center&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;right&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Attribute names and attribute values are case-insensitive. However, the World Wide Web Consortium (W3C) recommends lowercase attributes/attribute values in their HTML 4 recommendation.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/rJQ2Po&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt; 
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
 
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt; 
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Align Attribute  Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt; 
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt; 
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;align&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;left&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is left aligned&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt; 
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;align&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;center&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is center aligned&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt; 
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;align&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;right&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is right aligned&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt; 
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will display the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/attributes.htm&quot; width=&quot;600px&quot; height=&quot;150px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Core Attributes&lt;/h2&gt;
&lt;p&gt;The four core attributes that can be used on the majority of HTML elements (although not all) are &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;Id&lt;/li&gt;
&lt;li&gt;Title&lt;/li&gt;
&lt;li&gt;Class&lt;/li&gt;
&lt;li&gt;Style&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;The Id Attribute&lt;/h3&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;id&lt;/strong&gt;&amp;nbsp;attribute of an HTML tag can be used to uniquely identify any element within an HTML page. There are two primary reasons that you might want to use an id attribute on an element &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;If an element carries an id attribute as a unique identifier, it is possible to identify just that element and its content.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you have two elements of the same name within a Web page (or style sheet), you can use the id attribute to distinguish between elements that have the same name.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We will discuss style sheet in separate tutorial. For now, let&#39;s use the id attribute to distinguish between two paragraph elements as shown below.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&amp;lt;p id = &quot;html&quot;&amp;gt;This para explains what is HTML&amp;lt;/p&amp;gt;
&amp;lt;p id = &quot;css&quot;&amp;gt;This para explains what is Cascading Style Sheet&amp;lt;/p&amp;gt;
&lt;/pre&gt;
&lt;h3&gt;The title Attribute&lt;/h3&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;title&lt;/strong&gt;&amp;nbsp;attribute gives a suggested title for the element. They syntax for the&amp;nbsp;&lt;strong&gt;title&lt;/strong&gt;&amp;nbsp;attribute is similar as explained for&amp;nbsp;&lt;strong&gt;id&lt;/strong&gt;&amp;nbsp;attribute &amp;minus;&lt;/p&gt;
&lt;p&gt;The behavior of this attribute will depend upon the element that carries it, although it is often displayed as a tooltip when cursor comes over the element or while the element is loading.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/Xq2ok1&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The title Attribute Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;h3&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;title&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Hello HTML!&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Titled Heading Tag Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/title_attribute.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;Now try to bring your cursor over &quot;Titled Heading Tag Example&quot; and you will see that whatever title you used in your code is coming out as a tooltip of the cursor.&lt;/p&gt;
&lt;h3&gt;The class Attribute&lt;/h3&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;class&lt;/strong&gt;&amp;nbsp;attribute is used to associate an element with a style sheet, and specifies the class of element. You will learn more about the use of the class attribute when you will learn Cascading Style Sheet (CSS). So for now you can avoid it.&lt;/p&gt;
&lt;p&gt;The value of the attribute may also be a space-separated list of class names. For example &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;class = &quot;className1 className2 className3&quot;
&lt;/pre&gt;
&lt;h3&gt;The style Attribute&lt;/h3&gt;
&lt;p&gt;The style attribute allows you to specify Cascading Style Sheet (CSS) rules within the element.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/FreFRI&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The style Attribute&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;family&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;arial&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:#&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;FF0000&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Some text...&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/style_attribute.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;At this point of time, we are not learning CSS, so just let&#39;s proceed without bothering much about CSS. Here, you need to understand what are HTML attributes and how they can be used while formatting content.&lt;/p&gt;
&lt;h2&gt;Internationalization Attributes&lt;/h2&gt;
&lt;p&gt;There are three internationalization attributes, which are available for most (although not all) XHTML elements.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;dir&lt;/li&gt;
&lt;li&gt;lang&lt;/li&gt;
&lt;li&gt;xml:lang&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;The dir Attribute&lt;/h3&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;dir&lt;/strong&gt;&amp;nbsp;attribute allows you to indicate to the browser about the direction in which the text should flow. The dir attribute can take one of two values, as you can see in the table that follows &amp;minus;&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ltr&lt;/td&gt;
&lt;td&gt;Left to right (the default value)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;rtl&lt;/td&gt;
&lt;td&gt;Right to left (for languages such as Hebrew or Arabic that are read right to left)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/a9JBAz&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;dir&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;rtl&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Display Directions&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      This is how IE 5 renders right-to-left directed text.
   &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/dir_attribute.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;When&amp;nbsp;&lt;em&gt;dir&lt;/em&gt;&amp;nbsp;attribute is used within the &amp;lt;html&amp;gt; tag, it determines how text will be presented within the entire document. When used within another tag, it controls the text&#39;s direction for just the content of that tag.&lt;/p&gt;
&lt;h3&gt;The lang Attribute&lt;/h3&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;lang&lt;/strong&gt;&amp;nbsp;attribute allows you to indicate the main language used in a document, but this attribute was kept in HTML only for backwards compatibility with earlier versions of HTML. This attribute has been replaced by the&amp;nbsp;&lt;strong&gt;xml:lang&lt;/strong&gt;&amp;nbsp;attribute in new XHTML documents.&lt;/p&gt;
&lt;p&gt;The values of the&amp;nbsp;&lt;em&gt;lang&lt;/em&gt;&amp;nbsp;attribute are ISO-639 standard two-character language codes. Check&amp;nbsp;&lt;a href=&quot;https://www.tutorialspoint.com/html/language_iso_codes.htm&quot;&gt;&lt;strong&gt;HTML Language Codes: ISO 639&lt;/strong&gt;&lt;/a&gt;&amp;nbsp;for a complete list of language codes.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/Hf0XPh&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;lang&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;en&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;English Language Page&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      This page is using English Language
   &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;

&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/lang_attribute.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;The xml:lang Attribute&lt;/h2&gt;
&lt;p&gt;The&amp;nbsp;&lt;em&gt;xml:lang&lt;/em&gt;&amp;nbsp;attribute is the XHTML replacement for the&amp;nbsp;&lt;em&gt;lang&lt;/em&gt;&amp;nbsp;attribute. The value of the&amp;nbsp;&lt;em&gt;xml:lang&lt;/em&gt;&amp;nbsp;attribute should be an ISO-639 country code as mentioned in previous section.&lt;/p&gt;
&lt;h3&gt;Generic Attributes&lt;/h3&gt;
&lt;p&gt;Here&#39;s a table of some other attributes that are readily usable with many of the HTML tags.&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Attribute&lt;/th&gt;
&lt;th&gt;Options&lt;/th&gt;
&lt;th&gt;Function&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;align&lt;/td&gt;
&lt;td&gt;right, left, center&lt;/td&gt;
&lt;td&gt;Horizontally aligns tags&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;valign&lt;/td&gt;
&lt;td&gt;top, middle, bottom&lt;/td&gt;
&lt;td&gt;Vertically aligns tags within an HTML element.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;bgcolor&lt;/td&gt;
&lt;td&gt;numeric, hexidecimal, RGB values&lt;/td&gt;
&lt;td&gt;Places a background color behind an element&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;background&lt;/td&gt;
&lt;td&gt;URL&lt;/td&gt;
&lt;td&gt;Places a background image behind an element&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;id&lt;/td&gt;
&lt;td&gt;User Defined&lt;/td&gt;
&lt;td&gt;Names an element for use with Cascading Style Sheets.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;class&lt;/td&gt;
&lt;td&gt;User Defined&lt;/td&gt;
&lt;td&gt;Classifies an element for use with Cascading Style Sheets.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;width&lt;/td&gt;
&lt;td&gt;Numeric Value&lt;/td&gt;
&lt;td&gt;Specifies the width of tables, images, or table cells.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;height&lt;/td&gt;
&lt;td&gt;Numeric Value&lt;/td&gt;
&lt;td&gt;Specifies the height of tables, images, or table cells.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;title&lt;/td&gt;
&lt;td&gt;User Defined&lt;/td&gt;
&lt;td&gt;&quot;Pop-up&quot; title of the elements.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;We will see related examples as we will proceed to study other HTML tags. For a complete list of HTML Tags and related attributes please check reference to&amp;nbsp;&lt;a href=&quot;https://www.tutorialspoint.com/html/html_tags_reference.htm&quot;&gt;HTML Tags List&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;Formatting&lt;/h1&gt;
&lt;p&gt;If you use a word processor, you must be familiar with the ability to make text bold, italicized, or underlined; these are just three of the ten options available to indicate how text can appear in HTML and XHTML.&lt;/p&gt;
&lt;h2&gt;Bold Text&lt;/h2&gt;
&lt;p&gt;Anything that appears within&amp;nbsp;&lt;strong&gt;&amp;lt;b&amp;gt;...&amp;lt;/b&amp;gt;&lt;/strong&gt;&amp;nbsp;element, is displayed in bold as shown below &amp;minus;&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/5KMKkW&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Bold Text Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The following word uses a &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;b&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;bold&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/b&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; typeface.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/bold_text.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Italic Text&lt;/h2&gt;
&lt;p&gt;Anything that appears within&amp;nbsp;&lt;strong&gt;&amp;lt;i&amp;gt;...&amp;lt;/i&amp;gt;&lt;/strong&gt;&amp;nbsp;element is displayed in italicized as shown below &amp;minus;&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/OJgqcS&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Italic Text Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The following word uses an &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;i&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;italicized&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/i&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; typeface.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/italic_text.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Underlined Text&lt;/h2&gt;
&lt;p&gt;Anything that appears within&amp;nbsp;&lt;strong&gt;&amp;lt;u&amp;gt;...&amp;lt;/u&amp;gt;&lt;/strong&gt;&amp;nbsp;element, is displayed with underline as shown below &amp;minus;&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/5Y75MX&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Underlined Text Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The following word uses an &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;u&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;underlined&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/u&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; typeface.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/underlined_text.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Strike Text&lt;/h2&gt;
&lt;p&gt;Anything that appears within&amp;nbsp;&lt;strong&gt;&amp;lt;strike&amp;gt;...&amp;lt;/strike&amp;gt;&lt;/strong&gt;&amp;nbsp;element is displayed with strikethrough, which is a thin line through the text as shown below &amp;minus;&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/HIkU7n&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Strike Text Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The following word uses a &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;strike&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;strikethrough&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/strike&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; typeface.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/strike_text.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Monospaced Font&lt;/h2&gt;
&lt;p&gt;The content of a&amp;nbsp;&lt;strong&gt;&amp;lt;tt&amp;gt;...&amp;lt;/tt&amp;gt;&lt;/strong&gt;&amp;nbsp;element is written in monospaced font. Most of the fonts are known as variable-width fonts because different letters are of different widths (for example, the letter &#39;m&#39; is wider than the letter &#39;i&#39;). In a monospaced font, however, each letter has the same width.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/7XdwHl&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Monospaced Font Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The following word uses a &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;tt&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;monospaced&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/tt&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; typeface.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/monospaced_font.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Superscript Text&lt;/h2&gt;
&lt;p&gt;The content of a&amp;nbsp;&lt;strong&gt;&amp;lt;sup&amp;gt;...&amp;lt;/sup&amp;gt;&lt;/strong&gt;&amp;nbsp;element is written in superscript; the font size used is the same size as the characters surrounding it but is displayed half a character&#39;s height above the other characters.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/ASSDpm&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Superscript Text Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The following word uses a &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;sup&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;superscript&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/sup&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; typeface.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/superscript_text.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Subscript Text&lt;/h2&gt;
&lt;p&gt;The content of a&amp;nbsp;&lt;strong&gt;&amp;lt;sub&amp;gt;...&amp;lt;/sub&amp;gt;&lt;/strong&gt;&amp;nbsp;element is written in subscript; the font size used is the same as the characters surrounding it, but is displayed half a character&#39;s height beneath the other characters.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/FS24k4&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Subscript Text Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The following word uses a &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;sub&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;subscript&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/sub&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; typeface.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/subscript_text.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Inserted Text&lt;/h2&gt;
&lt;p&gt;Anything that appears within&amp;nbsp;&lt;strong&gt;&amp;lt;ins&amp;gt;...&amp;lt;/ins&amp;gt;&lt;/strong&gt;&amp;nbsp;element is displayed as inserted text.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/8WK66t&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Inserted Text Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;I want to drink &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;del&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;cola&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/del&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;&amp;lt;ins&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;wine&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/ins&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/inserted_text.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Deleted Text&lt;/h2&gt;
&lt;p&gt;Anything that appears within&amp;nbsp;&lt;strong&gt;&amp;lt;del&amp;gt;...&amp;lt;/del&amp;gt;&lt;/strong&gt;&amp;nbsp;element, is displayed as deleted text.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/HAK4s7&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Deleted Text Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;I want to drink &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;del&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;cola&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/del&amp;gt;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;&amp;lt;ins&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;wine&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/ins&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/delete_text.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Larger Text&lt;/h2&gt;
&lt;p&gt;The content of the&amp;nbsp;&lt;strong&gt;&amp;lt;big&amp;gt;...&amp;lt;/big&amp;gt;&lt;/strong&gt;&amp;nbsp;element is displayed one font size larger than the rest of the text surrounding it as shown below &amp;minus;&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/XGxTMW&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Larger Text Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The following word uses a &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;big&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;big&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/big&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; typeface.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/larger_text.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Smaller Text&lt;/h2&gt;
&lt;p&gt;The content of the&amp;nbsp;&lt;strong&gt;&amp;lt;small&amp;gt;...&amp;lt;/small&amp;gt;&lt;/strong&gt;&amp;nbsp;element is displayed one font size smaller than the rest of the text surrounding it as shown below &amp;minus;&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/BtVDGJ&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Smaller Text Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;The following word uses a &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;small&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;small&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/small&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; typeface.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;

&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/smaller_text.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Grouping Content&lt;/h2&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;&amp;lt;div&amp;gt;&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;&amp;lt;span&amp;gt;&lt;/strong&gt;&amp;nbsp;elements allow you to group together several elements to create sections or subsections of a page.&lt;/p&gt;
&lt;p&gt;For example, you might want to put all of the footnotes on a page within a &amp;lt;div&amp;gt; element to indicate that all of the elements within that &amp;lt;div&amp;gt; element relate to the footnotes. You might then attach a style to this &amp;lt;div&amp;gt; element so that they appear using a special set of style rules.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/tqWkee&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Div Tag Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;menu&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;align&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;middle&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/index.htm&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HOME&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; | 
         &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/about/contact_us.htm&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;CONTACT&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; | 
         &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/about/index.htm&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ABOUT&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;content&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;align&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;left&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;bgcolor&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;white&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;h5&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Content Articles&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h5&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Actual content goes here.....&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/grouping_content.htm&quot; width=&quot;600px&quot; height=&quot;150px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;The &amp;lt;span&amp;gt; element, on the other hand, can be used to group inline elements only. So, if you have a part of a sentence or paragraph which you want to group together, you could use the &amp;lt;span&amp;gt; element as follows.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/R5ONzp&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Span Tag Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is the example of &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;green&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;span tag&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         and the &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;red&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;div tag&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; alongwith CSS&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/span_tag.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;These tags are commonly used with CSS to allow you to attach a style to a section of a page.&lt;/p&gt;

&lt;h1&gt;Images&lt;/h1&gt;
&lt;p&gt;Images are very important to beautify as well as to depict many complex concepts in simple way on your web page. This tutorial will take you through simple steps to use images in your web pages.&lt;/p&gt;
&lt;h2&gt;Insert Image&lt;/h2&gt;
&lt;p&gt;You can insert any image in your web page by using&amp;nbsp;&lt;strong&gt;&amp;lt;img&amp;gt;&lt;/strong&gt;&amp;nbsp;tag. Following is the simple syntax to use this tag.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&amp;lt;img src = &quot;Image URL&quot; ... attributes-list/&amp;gt;
&lt;/pre&gt;
&lt;p&gt;The &amp;lt;img&amp;gt; tag is an empty tag, which means that, it can contain only list of attributes and it has no closing tag.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;To try following example, let&#39;s keep our HTML file test.htm and image file test.png in the same directory &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/9KkHGq&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Using Image in Webpage&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Simple Image Insert&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/html/images/test.png&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;alt&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Test Image&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/insert_image.htm&quot; width=&quot;600px&quot; height=&quot;200px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;You can use PNG, JPEG or GIF image file based on your comfort but make sure you specify correct image file name in&amp;nbsp;&lt;strong&gt;src&lt;/strong&gt;&amp;nbsp;attribute. Image name is always case sensitive.&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;alt&lt;/strong&gt;&amp;nbsp;attribute is a mandatory attribute which specifies an alternate text for an image, if the image cannot be displayed.&lt;/p&gt;
&lt;h2&gt;Set Image Location&lt;/h2&gt;
&lt;p&gt;Usually we keep all the images in a separate directory. So let&#39;s keep HTML file test.htm in our home directory and create a subdirectory&amp;nbsp;&lt;strong&gt;images&lt;/strong&gt;&amp;nbsp;inside the home directory where we will keep our image test.png.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Assuming our image location is &quot;image/test.png&quot;, try the following example &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/bQc7oN&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Using Image in Webpage&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Simple Image Insert&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/html/images/test.png&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;alt&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Test Image&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/set_image_location.htm&quot; width=&quot;600px&quot; height=&quot;200px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Set Image Width/Height&lt;/h2&gt;
&lt;p&gt;You can set image width and height based on your requirement using&amp;nbsp;&lt;strong&gt;width&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;height&lt;/strong&gt;attributes. You can specify width and height of the image in terms of either pixels or percentage of its actual size.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/esEKg5&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Set Image Width and Height&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Setting image width and height&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/html/images/test.png&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;alt&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Test Image&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;150&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;height&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;100&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/set_image_width.htm&quot; width=&quot;600px&quot; height=&quot;200px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Set Image Border&lt;/h2&gt;
&lt;p&gt;By default, image will have a border around it, you can specify border thickness in terms of pixels using border attribute. A thickness of 0 means, no border around the picture.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/Jh9j17&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Set Image Border&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Setting image Border&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/html/images/test.png&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;alt&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Test Image&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;border&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;3&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/set_image_border.htm&quot; width=&quot;600px&quot; height=&quot;200px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Set Image Alignment&lt;/h2&gt;
&lt;p&gt;By default, image will align at the left side of the page, but you can use&amp;nbsp;&lt;strong&gt;align&lt;/strong&gt;&amp;nbsp;attribute to set it in the center or right.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/X2SPGi&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Set Image Alignment&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Setting image Alignment&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/html/images/test.png&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;alt&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Test Image&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;border&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;3&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;align&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;right&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/set_image_alignment.htm&quot; width=&quot;600px&quot; height=&quot;200px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Free Web Graphics&lt;/h2&gt;
&lt;p&gt;For Free Web Graphics including patterns you can look into&amp;nbsp;&lt;a href=&quot;https://www.tutorialspoint.com/free_web_graphics.htm&quot;&gt;Free Web Graphics&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;Tables&lt;/h1&gt;
&lt;p&gt;The HTML tables allow web authors to arrange data like text, images, links, other tables, etc. into rows and columns of cells.&lt;/p&gt;
&lt;p&gt;The HTML tables are created using the&amp;nbsp;&lt;strong&gt;&amp;lt;table&amp;gt;&lt;/strong&gt;&amp;nbsp;tag in which the&amp;nbsp;&lt;strong&gt;&amp;lt;tr&amp;gt;&lt;/strong&gt;&amp;nbsp;tag is used to create table rows and&amp;nbsp;&lt;strong&gt;&amp;lt;td&amp;gt;&lt;/strong&gt;&amp;nbsp;tag is used to create data cells. The elements under &amp;lt;td&amp;gt; are regular and left aligned by default&lt;/p&gt;
&lt;h2&gt;Example&lt;/h2&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/mZMibe&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Tables&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;table&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;border&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;1&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Row 1, Column 1&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Row 1, Column 2&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
         
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Row 2, Column 1&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Row 2, Column 2&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/table.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;Here, the&amp;nbsp;&lt;strong&gt;border&lt;/strong&gt;&amp;nbsp;is an attribute of &amp;lt;table&amp;gt; tag and it is used to put a border across all the cells. If you do not need a border, then you can use border = &quot;0&quot;.&lt;/p&gt;
&lt;h2&gt;Table Heading&lt;/h2&gt;
&lt;p&gt;Table heading can be defined using&amp;nbsp;&lt;strong&gt;&amp;lt;th&amp;gt;&lt;/strong&gt;&amp;nbsp;tag. This tag will be put to replace &amp;lt;td&amp;gt; tag, which is used to represent actual data cell. Normally you will put your top row as table heading as shown below, otherwise you can use &amp;lt;th&amp;gt; element in any row. Headings, which are defined in &amp;lt;th&amp;gt; tag are centered and bold by default.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/7LeM8F&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Table Header&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;table&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;border&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;1&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;th&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;th&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Salary&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Ramesh Raman&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;5000&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
         
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Shabbir Hussein&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;7000&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
   
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/table_heading.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Cellpadding and Cellspacing Attributes&lt;/h2&gt;
&lt;p&gt;There are two attributes called&amp;nbsp;&lt;em&gt;cellpadding&lt;/em&gt;&amp;nbsp;and&amp;nbsp;&lt;em&gt;cellspacing&lt;/em&gt;&amp;nbsp;which you will use to adjust the white space in your table cells. The cellspacing attribute defines space between table cells, while cellpadding represents the distance between cell borders and the content within a cell.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/P5QBh7&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Table Cellpadding&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;table&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;border&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;1&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;cellpadding&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;5&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;cellspacing&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;5&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;th&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;th&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Salary&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Ramesh Raman&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;5000&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Shabbir Hussein&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;7000&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/cellpadding_cellspacing.htm&quot; width=&quot;600px&quot; height=&quot;150px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Colspan and Rowspan Attributes&lt;/h2&gt;
&lt;p&gt;You will use&amp;nbsp;&lt;strong&gt;colspan&lt;/strong&gt;&amp;nbsp;attribute if you want to merge two or more columns into a single column. Similar way you will use&amp;nbsp;&lt;strong&gt;rowspan&lt;/strong&gt;&amp;nbsp;if you want to merge two or more rows.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/ltvfv5&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Table Colspan/Rowspan&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;table&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;border&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;1&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;th&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Column 1&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;th&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Column 2&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;th&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Column 3&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;rowspan&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;2&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Row 1 Cell 1&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Row 1 Cell 2&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Row 1 Cell 3&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Row 2 Cell 2&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Row 2 Cell 3&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;colspan&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;3&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Row 3 Cell 1&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/colspan_and_rowspan_attributes.htm&quot; width=&quot;600px&quot; height=&quot;150px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Tables Backgrounds&lt;/h2&gt;
&lt;p&gt;You can set table background using one of the following two ways &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;bgcolor&lt;/strong&gt;&amp;nbsp;attribute &amp;minus; You can set background color for whole table or just for one cell.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;background&lt;/strong&gt;&amp;nbsp;attribute &amp;minus; You can set background image for whole table or just for one cell.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can also set border color also using&amp;nbsp;&lt;strong&gt;bordercolor&lt;/strong&gt;&amp;nbsp;attribute.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&amp;nbsp;&amp;minus; The&amp;nbsp;&lt;em&gt;bgcolor&lt;/em&gt;,&amp;nbsp;&lt;em&gt;background&lt;/em&gt;, and&amp;nbsp;&lt;em&gt;bordercolor&lt;/em&gt;&amp;nbsp;attributes deprecated in HTML5. Do not use these attributes.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/pPuSKz&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Table Background&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;table&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;border&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;1&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;bordercolor&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;green&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;bgcolor&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;yellow&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;th&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Column 1&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;th&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Column 2&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;th&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Column 3&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;rowspan&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;2&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Row 1 Cell 1&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Row 1 Cell 2&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Row 1 Cell 3&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Row 2 Cell 2&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Row 2 Cell 3&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;colspan&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;3&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Row 3 Cell 1&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/table_background.htm&quot; width=&quot;600px&quot; height=&quot;150px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;Here is an example of using&amp;nbsp;&lt;strong&gt;background&lt;/strong&gt;&amp;nbsp;attribute. Here we will use an image available in /images directory.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/MBJetN&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Table Background&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;table&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;border&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;1&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;bordercolor&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;green&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;background&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/images/test.png&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;th&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Column 1&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;th&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Column 2&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;th&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Column 3&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;rowspan&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;2&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Row 1 Cell 1&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Row 1 Cell 2&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Row 1 Cell 3&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Row 2 Cell 2&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Row 2 Cell 3&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;colspan&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;3&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Row 3 Cell 1&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result. Here background image did not apply to table&#39;s header.&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/image_background.htm&quot; width=&quot;600px&quot; height=&quot;150px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Table Height and Width&lt;/h2&gt;
&lt;p&gt;You can set a table width and height using&amp;nbsp;&lt;strong&gt;width&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;height&lt;/strong&gt;&amp;nbsp;attributes. You can specify table width or height in terms of pixels or in terms of percentage of available screen area.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/HUEBv2&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Table Width/Height&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;table&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;border&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;1&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;400&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;height&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;150&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Row 1, Column 1&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Row 1, Column 2&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
         
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Row 2, Column 1&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Row 2, Column 2&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/table_height_width.htm&quot; width=&quot;600px&quot; height=&quot;170px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Table Caption&lt;/h2&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;caption&lt;/strong&gt;&amp;nbsp;tag will serve as a title or explanation for the table and it shows up at the top of the table. This tag is deprecated in newer version of HTML/XHTML.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/H0tfxX&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Table Caption&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;table&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;border&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;1&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;100%&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;caption&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is the caption&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/caption&amp;gt;&lt;/span&gt;
         
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;row 1, column 1&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;row 1, columnn 2&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
         
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;row 2, column 1&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;row 2, columnn 2&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/table_caption.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Table Header, Body, and Footer&lt;/h2&gt;
&lt;p&gt;Tables can be divided into three portions &amp;minus; a header, a body, and a foot. The head and foot are rather similar to headers and footers in a word-processed document that remain the same for every page, while the body is the main content holder of the table.&lt;/p&gt;
&lt;p&gt;The three elements for separating the head, body, and foot of a table are &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&amp;lt;thead&amp;gt;&lt;/strong&gt;&amp;nbsp;&amp;minus; to create a separate table header.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&amp;lt;tbody&amp;gt;&lt;/strong&gt;&amp;nbsp;&amp;minus; to indicate the main body of the table.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&amp;lt;tfoot&amp;gt;&lt;/strong&gt;&amp;nbsp;&amp;minus; to create a separate table footer.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A table may contain several &amp;lt;tbody&amp;gt; elements to indicate&amp;nbsp;&lt;em&gt;different pages&lt;/em&gt;&amp;nbsp;or groups of data. But it is notable that &amp;lt;thead&amp;gt; and &amp;lt;tfoot&amp;gt; tags should appear before &amp;lt;tbody&amp;gt;&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/tGLRYt&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Table&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;table&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;border&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;1&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;100%&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;thead&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;colspan&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;4&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is the head of the table&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/thead&amp;gt;&lt;/span&gt;
         
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tfoot&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;colspan&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;4&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is the foot of the table&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tfoot&amp;gt;&lt;/span&gt;
         
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tbody&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Cell 1&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Cell 2&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Cell 3&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Cell 4&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tbody&amp;gt;&lt;/span&gt;
         
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/header_body_footer.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Nested Tables&lt;/h2&gt;
&lt;p&gt;You can use one table inside another table. Not only tables you can use almost all the tags inside table data tag &amp;lt;td&amp;gt;.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Following is the example of using another table and other tags inside a table cell.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/yGjb0U&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Table&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;table&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;border&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;1&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;100%&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;table&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;border&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;1&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;100%&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
                  &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
                     &lt;span class=&quot;tag&quot;&gt;&amp;lt;th&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
                     &lt;span class=&quot;tag&quot;&gt;&amp;lt;th&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Salary&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
                  &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
                  &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
                     &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Ramesh Raman&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
                     &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;5000&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
                  &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
                  &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
                     &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Shabbir Hussein&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
                     &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;7000&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
                  &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
         
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/nested_table.htm&quot; width=&quot;600px&quot; height=&quot;150px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;

&lt;h1&gt;List&lt;/h1&gt;
&lt;p&gt;HTML offers web authors three ways for specifying lists of information. All lists must contain one or more list elements. Lists may contain &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&amp;lt;ul&amp;gt;&lt;/strong&gt;&amp;nbsp;&amp;minus; An unordered list. This will list items using plain bullets.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&amp;lt;ol&amp;gt;&lt;/strong&gt;&amp;nbsp;&amp;minus; An ordered list. This will use different schemes of numbers to list your items.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&amp;lt;dl&amp;gt;&lt;/strong&gt;&amp;nbsp;&amp;minus; A definition list. This arranges your items in the same way as they are arranged in a dictionary.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;HTML Unordered Lists&lt;/h2&gt;
&lt;p&gt;An unordered list is a collection of related items that have no special order or sequence. This list is created by using HTML&amp;nbsp;&lt;strong&gt;&amp;lt;ul&amp;gt;&lt;/strong&gt;&amp;nbsp;tag. Each item in the list is marked with a bullet.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/QvdUjX&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Unordered List&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Beetroot&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Ginger&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Potato&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Radish&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
   
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/unordered_lists.htm&quot; width=&quot;600px&quot; height=&quot;120px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;The type Attribute&lt;/h2&gt;
&lt;p&gt;You can use&amp;nbsp;&lt;strong&gt;type&lt;/strong&gt;&amp;nbsp;attribute for &amp;lt;ul&amp;gt; tag to specify the type of bullet you like. By default, it is a disc. Following are the possible options &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&amp;lt;ul type = &quot;square&quot;&amp;gt;
&amp;lt;ul type = &quot;disc&quot;&amp;gt;
&amp;lt;ul type = &quot;circle&quot;&amp;gt;
&lt;/pre&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Following is an example where we used &amp;lt;ul type = &quot;square&quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/AGkGec&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Unordered List&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;ul&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;square&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Beetroot&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Ginger&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Potato&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Radish&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;

&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/type_attribute.htm&quot; width=&quot;600px&quot; height=&quot;120px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Following is an example where we used &amp;lt;ul type = &quot;disc&quot;&amp;gt; &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/CxW0Mz&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Unordered List&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;ul&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;disc&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Beetroot&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Ginger&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Potato&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Radish&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;

&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/disc_type.htm&quot; width=&quot;600px&quot; height=&quot;120px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Following is an example where we used &amp;lt;ul type = &quot;circle&quot;&amp;gt; &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/iUFmCG&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Unordered List&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;ul&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;circle&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Beetroot&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Ginger&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Potato&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Radish&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/circle_type.htm&quot; width=&quot;600px&quot; height=&quot;120px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;HTML Ordered Lists&lt;/h2&gt;
&lt;p&gt;If you are required to put your items in a numbered list instead of bulleted, then HTML ordered list will be used. This list is created by using&amp;nbsp;&lt;strong&gt;&amp;lt;ol&amp;gt;&lt;/strong&gt;&amp;nbsp;tag. The numbering starts at one and is incremented by one for each successive ordered list element tagged with &amp;lt;li&amp;gt;.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/7bxlJW&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Ordered List&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;ol&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Beetroot&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Ginger&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Potato&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Radish&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/ol&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;

&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/ordered_lists.htm&quot; width=&quot;600px&quot; height=&quot;120px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;The type Attribute&lt;/h2&gt;
&lt;p&gt;You can use&amp;nbsp;&lt;strong&gt;type&lt;/strong&gt;&amp;nbsp;attribute for &amp;lt;ol&amp;gt; tag to specify the type of numbering you like. By default, it is a number. Following are the possible options &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&amp;lt;ol type = &quot;1&quot;&amp;gt; - Default-Case Numerals.
&amp;lt;ol type = &quot;I&quot;&amp;gt; - Upper-Case Numerals.
&amp;lt;ol type = &quot;i&quot;&amp;gt; - Lower-Case Numerals.
&amp;lt;ol type = &quot;A&quot;&amp;gt; - Upper-Case Letters.
&amp;lt;ol type = &quot;a&quot;&amp;gt; - Lower-Case Letters.
&lt;/pre&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Following is an example where we used &amp;lt;ol type = &quot;1&quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/1IgyrU&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Ordered List&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;ol&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;1&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Beetroot&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Ginger&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Potato&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Radish&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/ol&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;

&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/default_case_numerals.htm&quot; width=&quot;600px&quot; height=&quot;120px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Following is an example where we used &amp;lt;ol type = &quot;I&quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/LlRUhH&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Ordered List&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;ol&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;I&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Beetroot&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Ginger&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Potato&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Radish&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/ol&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/upper_case_numerals.htm&quot; width=&quot;600px&quot; height=&quot;120px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Following is an example where we used &amp;lt;ol type = &quot;i&quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/VJqDVU&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Ordered List&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;ol&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;i&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Beetroot&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Ginger&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Potato&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Radish&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/ol&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/lower_case_numerals.htm&quot; width=&quot;600px&quot; height=&quot;120px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Following is an example where we used &amp;lt;ol type = &quot;A&quot; &amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/NN69sS&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Ordered List&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;ol&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;A&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Beetroot&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Ginger&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Potato&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Radish&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/ol&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/upper_case_letters.htm&quot; width=&quot;600px&quot; height=&quot;120px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Following is an example where we used &amp;lt;ol type = &quot;a&quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/kCZI20&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Ordered List&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;ol&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;a&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Beetroot&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Ginger&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Potato&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Radish&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/ol&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/lower_case_letters.htm&quot; width=&quot;600px&quot; height=&quot;120px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;The start Attribute&lt;/h2&gt;
&lt;p&gt;You can use&amp;nbsp;&lt;strong&gt;start&lt;/strong&gt;&amp;nbsp;attribute for &amp;lt;ol&amp;gt; tag to specify the starting point of numbering you need. Following are the possible options &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&amp;lt;ol type = &quot;1&quot; start = &quot;4&quot;&amp;gt;    - Numerals starts with 4.
&amp;lt;ol type = &quot;I&quot; start = &quot;4&quot;&amp;gt;    - Numerals starts with IV.
&amp;lt;ol type = &quot;i&quot; start = &quot;4&quot;&amp;gt;    - Numerals starts with iv.
&amp;lt;ol type = &quot;a&quot; start = &quot;4&quot;&amp;gt;    - Letters starts with d.
&amp;lt;ol type = &quot;A&quot; start = &quot;4&quot;&amp;gt;    - Letters starts with D.
&lt;/pre&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Following is an example where we used &amp;lt;ol type = &quot;i&quot; start = &quot;4&quot; &amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/89i1AU&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Ordered List&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;ol&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;i&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;start&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;4&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Beetroot&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Ginger&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Potato&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Radish&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/ol&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/starts_with_four.htm&quot; width=&quot;600px&quot; height=&quot;120px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;HTML Definition Lists&lt;/h2&gt;
&lt;p&gt;HTML and XHTML supports a list style which is called&amp;nbsp;&lt;strong&gt;definition lists&lt;/strong&gt;&amp;nbsp;where entries are listed like in a dictionary or encyclopedia. The definition list is the ideal way to present a glossary, list of terms, or other name/value list.&lt;/p&gt;
&lt;p&gt;Definition List makes use of following three tags.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;&amp;lt;dl&amp;gt; &amp;minus; Defines the start of the list&lt;/li&gt;
&lt;li&gt;&amp;lt;dt&amp;gt; &amp;minus; A term&lt;/li&gt;
&lt;li&gt;&amp;lt;dd&amp;gt; &amp;minus; Term definition&lt;/li&gt;
&lt;li&gt;&amp;lt;/dl&amp;gt; &amp;minus; Defines the end of the list&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/yw2HxB&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Definition List&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;dl&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/b&amp;gt;&amp;lt;/dt&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;dd&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This stands for Hyper Text Markup Language&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/dd&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;dt&amp;gt;&amp;lt;b&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTTP&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/b&amp;gt;&amp;lt;/dt&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;dd&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This stands for Hyper Text Transfer Protocol&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/dd&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/dl&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/definition_list.htm&quot; width=&quot;600px&quot; height=&quot;120px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;

&lt;h1&gt;Text Links&lt;/h1&gt;
&lt;p&gt;A webpage can contain various links that take you directly to other pages and even specific parts of a given page. These links are known as hyperlinks.&lt;/p&gt;
&lt;p&gt;Hyperlinks allow visitors to navigate between Web sites by clicking on words, phrases, and images. Thus you can create hyperlinks using text or images available on a webpage.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&amp;nbsp;&amp;minus; I recommend you to go through a short tutorial on&amp;nbsp;&lt;a href=&quot;https://www.tutorialspoint.com/html/understanding_url_tutorial.htm&quot;&gt;Understanding URL&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Linking Documents&lt;/h2&gt;
&lt;p&gt;A link is specified using HTML tag &amp;lt;a&amp;gt;. This tag is called&amp;nbsp;&lt;strong&gt;anchor tag&lt;/strong&gt;&amp;nbsp;and anything between the opening &amp;lt;a&amp;gt; tag and the closing &amp;lt;/a&amp;gt; tag becomes part of the link and a user can click that part to reach to the linked document. Following is the simple syntax to use &amp;lt;a&amp;gt; tag.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&amp;lt;a href = &quot;Document URL&quot; ... attributes-list&amp;gt;Link Text&amp;lt;/a&amp;gt; 
&lt;/pre&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Let&#39;s try following example which links http://www.tutorialspoint.com at your page &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/XMwEnj&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Hyperlink Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click following link&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://www.tutorialspoint.com&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;target&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;_self&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Tutorials Point&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result, where you can click on the link generated to reach to the home page of Tutorials Point (in this example).&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/linking_documents.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;The target Attribute&lt;/h2&gt;
&lt;p&gt;We have used&amp;nbsp;&lt;strong&gt;target&lt;/strong&gt;&amp;nbsp;attribute in our previous example. This attribute is used to specify the location where linked document is opened. Following are the possible options &amp;minus;&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Sr.No&lt;/th&gt;
&lt;th&gt;Option &amp;amp; Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;1&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;_blank&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Opens the linked document in a new window or tab.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;2&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;_self&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Opens the linked document in the same frame.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;3&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;_parent&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Opens the linked document in the parent frame.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;4&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;_top&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Opens the linked document in the full body of the window.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;5&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;targetframe&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Opens the linked document in a named&amp;nbsp;&lt;em&gt;targetframe&lt;/em&gt;.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Try following example to understand basic difference in few options given for target attribute.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/Gt6jpS&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Hyperlink Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;base&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://www.tutorialspoint.com/&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click any of the following links&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/html/index.htm&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;target&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;_blank&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Opens in New&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; |
      &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/html/index.htm&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;target&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;_self&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Opens in Self&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; |
      &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/html/index.htm&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;target&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;_parent&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Opens in Parent&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; |
      &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/html/index.htm&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;target&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;_top&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Opens in Body&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;

&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result, where you can click on different links to understand the difference between various options given for target attribute.&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/usage_of_target.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Use of Base Path&lt;/h2&gt;
&lt;p&gt;When you link HTML documents related to the same website, it is not required to give a complete URL for every link. You can get rid of it if you use&amp;nbsp;&lt;strong&gt;&amp;lt;base&amp;gt;&lt;/strong&gt;&amp;nbsp;tag in your HTML document header. This tag is used to give a base path for all the links. So your browser will concatenate given relative path to this base path and will make a complete URL.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Following example makes use of &amp;lt;base&amp;gt; tag to specify base URL and later we can use relative path to all the links instead of giving complete URL for every link.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/fYgWRA&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Hyperlink Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;base&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://www.tutorialspoint.com/&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click following link&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/html/index.htm&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;target&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;_blank&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Tutorial&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result, where you can click on the link generated&amp;nbsp;&lt;strong&gt;HTML Tutorial&lt;/strong&gt;&amp;nbsp;to reach to the HTML tutorial.&lt;/p&gt;
&lt;p&gt;Now given URL &amp;lt;a href = &quot;/html/index.htm&quot; is being considered as &amp;lt;ahref = &quot;http://www.tutorialspoint.com/html/index.htm&quot;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/base_path.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Linking to a Page Section&lt;/h2&gt;
&lt;p&gt;You can create a link to a particular section of a given webpage by using&amp;nbsp;&lt;strong&gt;name&lt;/strong&gt;&amp;nbsp;attribute. This is a two-step process.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&amp;nbsp;&amp;minus; The&amp;nbsp;&lt;em&gt;name&lt;/em&gt;&amp;nbsp;attribute deprecated in HTML5. Do not use this attribute. Use&amp;nbsp;&lt;em&gt;id&lt;/em&gt;&amp;nbsp;and&amp;nbsp;&lt;em&gt;title&lt;/em&gt;&amp;nbsp;attribute instead.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;First create a link to the place where you want to reach with-in a webpage and name it using &amp;lt;a...&amp;gt; tag as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&amp;lt;h1&amp;gt;HTML Text Links &amp;lt;a name = &quot;top&quot;&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/h1&amp;gt;
&lt;/pre&gt;
&lt;p&gt;Second step is to create a hyperlink to link the document and place where you want to reach &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&amp;lt;a href = &quot;/html/html_text_links.htm#top&quot;&amp;gt;Go to the Top&amp;lt;/a&amp;gt;
&lt;/pre&gt;
&lt;p&gt;This will produce following link, where you can click on the link generated&amp;nbsp;&lt;strong&gt;Go to the Top&lt;/strong&gt;to reach to the top of the HTML Text Link tutorial.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&lt;a href=&quot;https://www.tutorialspoint.com/html/html_text_links.htm#top&quot;&gt;Go to the Top&lt;/a&gt; 
&lt;/pre&gt;
&lt;h2&gt;Setting Link Colors&lt;/h2&gt;
&lt;p&gt;You can set colors of your links, active links and visited links using&amp;nbsp;&lt;strong&gt;link&lt;/strong&gt;,&amp;nbsp;&lt;strong&gt;alink&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;vlink&lt;/strong&gt;attributes of &amp;lt;body&amp;gt; tag.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Save the following in test.htm and open it in any web browser to see how&amp;nbsp;&lt;strong&gt;link&lt;/strong&gt;,&amp;nbsp;&lt;strong&gt;alink&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;vlink&lt;/strong&gt;&amp;nbsp;attributes work.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/3eWU7z&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Hyperlink Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;base&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://www.tutorialspoint.com/&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;alink&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;#54A250&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;link&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;#040404&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;vlink&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;#F40633&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Click following link&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/html/index.htm&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;target&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;_blank&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Tutorial&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
   
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result. Just check color of the link before clicking on it, next check its color when you activate it and when the link has been visited.&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/setting_link.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Download Links&lt;/h2&gt;
&lt;p&gt;You can create text link to make your PDF, or DOC or ZIP files downloadable. This is very simple; you just need to give complete URL of the downloadable file as follows &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/pG57mM&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Hyperlink Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://www.tutorialspoint.com/page.pdf&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Download PDF File&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce following link and will be used to download a file.&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/download_links.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;File Download Dialog Box&lt;/h2&gt;
&lt;p&gt;Sometimes it is desired that you want to give an option where a user will click a link and it will pop up a &quot;File Download&quot; box to the user instead of displaying actual content. This is very easy and can be achieved using an HTTP header in your HTTP response.&lt;/p&gt;
&lt;p&gt;For example, if you want make a&amp;nbsp;&lt;strong&gt;Filename&lt;/strong&gt;&amp;nbsp;file downloadable from a given link then its syntax will be as follows.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;#!/usr/bin/perl

# Additional HTTP Header
print &quot;Content-Type:application/octet-stream; name = \&quot;FileName\&quot;\r\n&quot;;
print &quot;Content-Disposition:attachment; filename = \&quot;FileName\&quot;\r\n\n&quot;;

# Open the target file and list down its content as follows
open( FILE, &quot;&amp;lt;FileName&quot; );

while(read(FILE, $buffer, 100)){
   print(&quot;$buffer&quot;);
}&lt;/pre&gt;

&lt;h1&gt;Frames&lt;/h1&gt;
&lt;p&gt;HTML frames are used to divide your browser window into multiple sections where each section can load a separate HTML document. A collection of frames in the browser window is known as a frameset. The window is divided into frames in a similar way the tables are organized: into rows and columns.&lt;/p&gt;
&lt;h2&gt;Disadvantages of Frames&lt;/h2&gt;
&lt;p&gt;There are few drawbacks with using frames, so it&#39;s never recommended to use frames in your webpages &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;Some smaller devices cannot cope with frames often because their screen is not big enough to be divided up.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Sometimes your page will be displayed differently on different computers due to different screen resolution.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The browser&#39;s&amp;nbsp;&lt;em&gt;back&lt;/em&gt;&amp;nbsp;button might not work as the user hopes.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;There are still few browsers that do not support frame technology.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Creating Frames&lt;/h2&gt;
&lt;p&gt;To use frames on a page we use &amp;lt;frameset&amp;gt; tag instead of &amp;lt;body&amp;gt; tag. The &amp;lt;frameset&amp;gt; tag defines, how to divide the window into frames. The&amp;nbsp;&lt;strong&gt;rows&lt;/strong&gt;&amp;nbsp;attribute of &amp;lt;frameset&amp;gt; tag defines horizontal frames and&amp;nbsp;&lt;strong&gt;cols&lt;/strong&gt;&amp;nbsp;attribute defines vertical frames. Each frame is indicated by &amp;lt;frame&amp;gt; tag and it defines which HTML document shall open into the frame.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&amp;nbsp;&amp;minus; The &amp;lt;frame&amp;gt; tag deprecated in HTML5. Do not use this element.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Following is the example to create three horizontal frames &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/8Rc1Be&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Frames&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;frameset&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;rows&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;10%,80%,10%&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;frame&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;top&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/html/top_frame.htm&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;frame&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;main&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/html/main_frame.htm&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;frame&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;bottom&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/html/bottom_frame.htm&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
   
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;noframes&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Your browser does not support frames.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/noframes&amp;gt;&lt;/span&gt;
      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/frameset&amp;gt;&lt;/span&gt;
   
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/creating_frames.htm&quot; width=&quot;600px&quot; height=&quot;550px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Let&#39;s put the above example as follows, here we replaced rows attribute by cols and changed their width. This will create all the three frames vertically &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/VyKEFf&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Frames&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;frameset&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;cols&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;25%,50%,25%&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;frame&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;left&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/html/top_frame.htm&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;frame&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;center&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/html/main_frame.htm&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;frame&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;right&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/html/bottom_frame.htm&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;noframes&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Your browser does not support frames.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/noframes&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/frameset&amp;gt;&lt;/span&gt;
   
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/vertical_distribution_of_frames.htm&quot; width=&quot;600px&quot; height=&quot;200px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;The &amp;lt;frameset&amp;gt; Tag Attributes&lt;/h2&gt;
&lt;p&gt;Following are important attributes of the &amp;lt;frameset&amp;gt; tag &amp;minus;&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Sr.No&lt;/th&gt;
&lt;th&gt;Attribute &amp;amp; Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;cols&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Specifies how many columns are contained in the frameset and the size of each column. You can specify the width of each column in one of the four ways &amp;minus;&lt;/p&gt;
&lt;p&gt;Absolute values in pixels. For example, to create three vertical frames, use&amp;nbsp;&lt;em&gt;cols = &quot;100, 500, 100&quot;&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;A percentage of the browser window. For example, to create three vertical frames, use&amp;nbsp;&lt;em&gt;cols = &quot;10%, 80%, 10%&quot;&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Using a wildcard symbol. For example, to create three vertical frames, use&amp;nbsp;&lt;em&gt;cols = &quot;10%, *, 10%&quot;&lt;/em&gt;. In this case wildcard takes remainder of the window.&lt;/p&gt;
&lt;p&gt;As relative widths of the browser window. For example, to create three vertical frames, use&amp;nbsp;&lt;em&gt;cols = &quot;3*, 2*, 1*&quot;&lt;/em&gt;. This is an alternative to percentages. You can use relative widths of the browser window. Here the window is divided into sixths: the first column takes up half of the window, the second takes one third, and the third takes one sixth.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;rows&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This attribute works just like the cols attribute and takes the same values, but it is used to specify the rows in the frameset. For example, to create two horizontal frames, use&amp;nbsp;&lt;em&gt;rows = &quot;10%, 90%&quot;&lt;/em&gt;. You can specify the height of each row in the same way as explained above for columns.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;border&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This attribute specifies the width of the border of each frame in pixels. For example, border = &quot;5&quot;. A value of zero means no border.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;frameborder&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This attribute specifies whether a three-dimensional border should be displayed between frames. This attribute takes value either 1 (yes) or 0 (no). For example frameborder = &quot;0&quot; specifies no border.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;framespacing&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This attribute specifies the amount of space between frames in a frameset. This can take any integer value. For example framespacing = &quot;10&quot; means there should be 10 pixels spacing between each frames.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;The &amp;lt;frame&amp;gt; Tag Attributes&lt;/h2&gt;
&lt;p&gt;Following are the important attributes of &amp;lt;frame&amp;gt; tag &amp;minus;&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Sr.No&lt;/th&gt;
&lt;th&gt;Attribute &amp;amp; Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;src&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This attribute is used to give the file name that should be loaded in the frame. Its value can be any URL. For example, src = &quot;/html/top_frame.htm&quot; will load an HTML file available in html directory.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;name&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This attribute allows you to give a name to a frame. It is used to indicate which frame a document should be loaded into. This is especially important when you want to create links in one frame that load pages into an another frame, in which case the second frame needs a name to identify itself as the target of the link.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;frameborder&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This attribute specifies whether or not the borders of that frame are shown; it overrides the value given in the frameborder attribute on the &amp;lt;frameset&amp;gt; tag if one is given, and this can take values either 1 (yes) or 0 (no).&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;marginwidth&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This attribute allows you to specify the width of the space between the left and right of the frame&#39;s borders and the frame&#39;s content. The value is given in pixels. For example marginwidth = &quot;10&quot;.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;marginheight&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This attribute allows you to specify the height of the space between the top and bottom of the frame&#39;s borders and its contents. The value is given in pixels. For example marginheight = &quot;10&quot;.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;noresize&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;By default, you can resize any frame by clicking and dragging on the borders of a frame. The noresize attribute prevents a user from being able to resize the frame. For example noresize = &quot;noresize&quot;.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;scrolling&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This attribute controls the appearance of the scrollbars that appear on the frame. This takes values either &quot;yes&quot;, &quot;no&quot; or &quot;auto&quot;. For example scrolling = &quot;no&quot; means it should not have scroll bars.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;longdesc&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This attribute allows you to provide a link to another page containing a long description of the contents of the frame. For example longdesc = &quot;framedescription.htm&quot;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Browser Support for Frames&lt;/h2&gt;
&lt;p&gt;If a user is using any old browser or any browser, which does not support frames then &amp;lt;noframes&amp;gt; element should be displayed to the user.&lt;/p&gt;
&lt;p&gt;So you must place a &amp;lt;body&amp;gt; element inside the &amp;lt;noframes&amp;gt; element because the &amp;lt;frameset&amp;gt; element is supposed to replace the &amp;lt;body&amp;gt; element, but if a browser does not understand &amp;lt;frameset&amp;gt; element then it should understand what is inside the &amp;lt;body&amp;gt; element which is contained in a &amp;lt;noframes&amp;gt; element.&lt;/p&gt;
&lt;p&gt;You can put some nice message for your user having old browsers. For example,&amp;nbsp;&lt;em&gt;Sorry!! your browser does not support frames.&lt;/em&gt;&amp;nbsp;as shown in the above example.&lt;/p&gt;
&lt;h2&gt;Frame&#39;s name and target attributes&lt;/h2&gt;
&lt;p&gt;One of the most popular uses of frames is to place navigation bars in one frame and then load main pages into a separate frame.&lt;/p&gt;
&lt;p&gt;Let&#39;s see following example where a test.htm file has following code &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/DBmVdH&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Target Frames&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;frameset&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;cols&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;200, *&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;frame&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/html/menu.htm&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;menu_page&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;frame&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/html/main.htm&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;main_page&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;noframes&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Your browser does not support frames.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/noframes&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/frameset&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Here, we have created two columns to fill with two frames. The first frame is 200 pixels wide and will contain the navigation menu bar implemented by&amp;nbsp;&lt;strong&gt;menu.htm&lt;/strong&gt;&amp;nbsp;file. The second column fills in remaining space and will contain the main part of the page and it is implemented by&amp;nbsp;&lt;strong&gt;main.htm&lt;/strong&gt;&amp;nbsp;file. For all the three links available in menu bar, we have mentioned target frame as&amp;nbsp;&lt;strong&gt;main_page&lt;/strong&gt;, so whenever you click any of the links in menu bar, available link will open in main page.&lt;/p&gt;
&lt;p&gt;Following is the content of menu.htm file&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/MK6c5W&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;bgcolor&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;#4a7d49&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;http://www.google.com&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;target&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;main_page&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Google&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;br&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;br&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;http://www.microsoft.com&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;target&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;main_page&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Microsoft&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;br&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;br&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;http://news.bbc.co.uk&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;target&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;main_page&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;BBC News&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Following is the content of main.htm file &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/uUvcwY&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;bgcolor&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;#b5dcb3&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is main page and content from any link will be displayed here.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;So now click any link and see the result.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;When we load&amp;nbsp;&lt;strong&gt;test.htm&lt;/strong&gt;&amp;nbsp;file, it produces following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/test.htm&quot; width=&quot;600px&quot; height=&quot;200px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;Now you can try to click links available in the left panel and see the result. The&amp;nbsp;&lt;em&gt;targetattribute&lt;/em&gt;&amp;nbsp;can also take one of the following values &amp;minus;&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Sr.No&lt;/th&gt;
&lt;th&gt;Option &amp;amp; Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;_self&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Loads the page into the current frame.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;_blank&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Loads a page into a new browser window. Opening a new window.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;_parent&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Loads the page into the parent window, which in the case of a single frameset is the main browser window.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;_top&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Loads the page into the browser window, replacing any current frames.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;targetframe&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Loads the page into a named targetframe.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;h1&gt;Style Sheet&lt;/h1&gt;
&lt;p&gt;Cascading Style Sheets (CSS) describe how documents are presented on screens, in print, or perhaps how they are pronounced. W3C has actively promoted the use of style sheets on the Web since the consortium was founded in 1994.&lt;/p&gt;
&lt;p&gt;Cascading Style Sheets (CSS) provide easy and effective alternatives to specify various attributes for the HTML tags. Using CSS, you can specify a number of style properties for a given HTML element. Each property has a name and a value, separated by a colon (:). Each property declaration is separated by a semi-colon (;).&lt;/p&gt;
&lt;h2&gt;Example&lt;/h2&gt;
&lt;p&gt;First let&#39;s consider an example of HTML document which makes use of &amp;lt;font&amp;gt; tag and associated attributes to specify text color and font size &amp;minus;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&amp;nbsp;&amp;minus; The&amp;nbsp;&lt;em&gt;font&lt;/em&gt;&amp;nbsp;tag deprecated and it is supposed to be removed in a future version of HTML. So they should not be used rather, it&#39;s suggested to use CSS styles to manipulate your fonts. But still for learning purpose, this chapter will work with an example using the font tag.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/7YmU6P&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML CSS&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&amp;lt;font&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;color&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;green&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;size&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;5&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Hello, World!&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;

&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We can re-write above example with the help of Style Sheet as follows &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/7YmU6P&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML CSS&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;green&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;24px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Hello, World!&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;

&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/style_sheet_of_html.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;You can use CSS in three ways in your HTML document &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;External Style Sheet&lt;/strong&gt;&amp;nbsp;&amp;minus; Define style sheet rules in a separate .css file and then include that file in your HTML document using HTML &amp;lt;link&amp;gt; tag.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Internal Style Sheet&lt;/strong&gt;&amp;nbsp;&amp;minus; Define style sheet rules in header section of the HTML document using &amp;lt;style&amp;gt; tag.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Inline Style Sheet&lt;/strong&gt;&amp;nbsp;&amp;minus; Define style sheet rules directly along-with the HTML elements using&amp;nbsp;&lt;strong&gt;style&lt;/strong&gt;&amp;nbsp;attribute.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let&#39;s see all the three cases one by one with the help of suitable examples.&lt;/p&gt;
&lt;h2&gt;External Style Sheet&lt;/h2&gt;
&lt;p&gt;If you need to use your style sheet to various pages, then its always recommended to define a common style sheet in a separate file. A cascading style sheet file will have extension as&amp;nbsp;&lt;strong&gt;.css&lt;/strong&gt;&amp;nbsp;and it will be included in HTML files using &amp;lt;link&amp;gt; tag.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Consider we define a style sheet file&amp;nbsp;&lt;strong&gt;style.css&lt;/strong&gt;&amp;nbsp;which has following rules &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;red &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; red&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;thick &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;green &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;green&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Here we defined three CSS rules which will be applicable to three different classes defined for the HTML tags. I suggest you should not bother about how these rules are being defined because you will learn them while studying CSS. Now let&#39;s make use of the above external CSS file in our following HTML document &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/xpI3k5&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML External CSS&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;rel&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;stylesheet&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/css&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/html/style.css&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;red&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is red&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;thick&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is thick&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;green&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is green&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;thick green&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is thick and green&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;

&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/external_style_sheet.htm&quot; width=&quot;600px&quot; height=&quot;200px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Internal Style Sheet&lt;/h2&gt;
&lt;p&gt;If you want to apply Style Sheet rules to a single document only, then you can include those rules in header section of the HTML document using &amp;lt;style&amp;gt; tag.&lt;/p&gt;
&lt;p&gt;Rules defined in internal style sheet overrides the rules defined in an external CSS file.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Let&#39;s re-write above example once again, but here we will write style sheet rules in the same HTML document using &amp;lt;style&amp;gt; tag &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/rv3Bl4&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt; 
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
 
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt; 
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Internal CSS&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt; 
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;style&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/css&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt; 
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;red &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
            color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; red&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt; 
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt; 
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;thick&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
            font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt; 
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt; 
         &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;green &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
            color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;green&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt; 
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt; 
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt; 
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt; 
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;red&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is red&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;  
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;thick&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is thick&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;  
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;green&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is green&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;  
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;thick green&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is thick and green&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt; 
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/internal_style_sheet.htm&quot; width=&quot;600px&quot; height=&quot;200px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Inline Style Sheet&lt;/h2&gt;
&lt;p&gt;You can apply style sheet rules directly to any HTML element using&amp;nbsp;&lt;strong&gt;style&lt;/strong&gt;&amp;nbsp;attribute of the relevant tag. This should be done only when you are interested to make a particular change in any HTML element only.&lt;/p&gt;
&lt;p&gt;Rules defined inline with the element overrides the rules defined in an external CSS file as well as the rules defined in &amp;lt;style&amp;gt; element.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Let&#39;s re-write above example once again, but here we will write style sheet rules along with the HTML elements using&amp;nbsp;&lt;strong&gt;style&lt;/strong&gt;&amp;nbsp;attribute of those elements.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/AIIN7x&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt; 
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
 
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt; 
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Inline CSS&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt; 
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
 
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt; 
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;red&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is red&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;  
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is thick&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;  
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;green&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is green&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;  
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;green&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is thick and green&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt; 
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
 
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/inline_style_sheet.htm&quot; width=&quot;600px&quot; height=&quot;200px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;

&lt;h1&gt;Marquees&lt;/h1&gt;
&lt;p&gt;An HTML marquee is a scrolling piece of text displayed either horizontally across or vertically down your webpage depending on the settings. This is created by using HTML &amp;lt;marquees&amp;gt; tag.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&amp;nbsp;&amp;minus; The &amp;lt;marquee&amp;gt; tag deprecated in HTML5. Do not use this element, instead you can use JavaScript and CSS to create such effects.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;Syntax&lt;/h2&gt;
&lt;p&gt;A simple syntax to use HTML &amp;lt;marquee&amp;gt; tag is as follows &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&amp;lt;marquee attribute_name = &quot;attribute_value&quot;....more attributes&amp;gt;
   One or more lines or text message or image
&amp;lt;/marquee&amp;gt;
&lt;/pre&gt;
&lt;h2&gt;The &amp;lt;marquee&amp;gt; Tag Attributes&lt;/h2&gt;
&lt;p&gt;Following is the list of important attributes which can be used with &amp;lt;marquee&amp;gt; tag.&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Sr.No&lt;/th&gt;
&lt;th&gt;Attribute &amp;amp; Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;1&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;width&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This specifies the width of the marquee. This can be a value like 10 or 20% etc.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;2&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;height&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This specifies the height of the marquee. This can be a value like 10 or 20% etc.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;3&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;direction&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This specifies the direction in which marquee should scroll. This can be a value like&amp;nbsp;&lt;em&gt;up, down, left&lt;/em&gt;&amp;nbsp;or&amp;nbsp;&lt;em&gt;right&lt;/em&gt;.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;4&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;behavior&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This specifies the type of scrolling of the marquee. This can have a value like&amp;nbsp;&lt;em&gt;scroll, slide&lt;/em&gt;&amp;nbsp;and&amp;nbsp;&lt;em&gt;alternate&lt;/em&gt;.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;5&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;scrolldelay&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This specifies how long to delay between each jump. This will have a value like 10 etc.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;6&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;scrollamount&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This specifies the speed of marquee text. This can have a value like 10 etc.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;7&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;loop&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This specifies how many times to loop. The default value is INFINITE, which means that the marquee loops endlessly.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;8&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;bgcolor&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This specifies background color in terms of color name or color hex value.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;9&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;hspace&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This specifies horizontal space around the marquee. This can be a value like 10 or 20% etc.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;ts&quot;&gt;10&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;vspace&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This specifies vertical space around the marquee. This can be a value like 10 or 20% etc.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Below are few examples to demonstrate the usage of marquee tag.&lt;/p&gt;
&lt;h3&gt;Examples - 1&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/Ngeujx&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML marquee Tag&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;marquee&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is basic example of marquee&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/marquee&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/basic_marquee.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h3&gt;Examples - 2&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/la66nv&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML marquee Tag&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;marquee&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;50%&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This example will take only 50% width&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/marquee&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/marquee_tag.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h3&gt;Examples - 3&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/yTCuVw&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML marquee Tag&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;marquee&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;direction&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;right&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This text will scroll from left to right&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/marquee&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/left_to_right_marquee.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h3&gt;Examples - 4&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/mVbuQ0&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML marquee Tag&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;marquee&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;direction&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;up&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This text will scroll from bottom to up&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/marquee&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/bottom_to_up_marquee.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;

&lt;h1&gt;Javascript&lt;/h1&gt;
&lt;p&gt;A&amp;nbsp;&lt;strong&gt;script&lt;/strong&gt;&amp;nbsp;is a small piece of program that can add interactivity to your website. For example, a script could generate a pop-up alert box message, or provide a dropdown menu. This script could be written using JavaScript or VBScript.&lt;/p&gt;
&lt;p&gt;You can write various small functions, called event handlers using any of the scripting language and then you can trigger those functions using HTML attributes.&lt;/p&gt;
&lt;p&gt;Now-a-days, only&amp;nbsp;&lt;strong&gt;JavaScript&lt;/strong&gt;&amp;nbsp;and associated frameworks are being used by most of the web developers, VBScript is not even supported by various major browsers.&lt;/p&gt;
&lt;p&gt;You can keep JavaScript code in a separate file and then include it wherever it&#39;s needed, or you can define functionality inside HTML document itself. Let&#39;s see both the cases one by one with suitable examples.&lt;/p&gt;
&lt;h2&gt;External JavaScript&lt;/h2&gt;
&lt;p&gt;If you are going to define a functionality which will be used in various HTML documents then it&#39;s better to keep that functionality in a separate JavaScript file and then include that file in your HTML documents. A JavaScript file will have extension as&amp;nbsp;&lt;strong&gt;.js&lt;/strong&gt;&amp;nbsp;and it will be included in HTML files using &amp;lt;script&amp;gt; tag.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Consider we define a small function using JavaScript in&amp;nbsp;&lt;strong&gt;script.js&lt;/strong&gt;&amp;nbsp;which has following code &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;function Hello() {
   alert(&quot;Hello, World&quot;);
}
&lt;/pre&gt;
&lt;p&gt;Now let&#39;s make use of the above external JavaScript file in our following HTML document &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/qz4BzE&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Javascript External Script&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;/html/script.js&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;button&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onclick&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Hello&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;ok&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Click Me&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;

&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result, where you can try to click on the given button &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/use_of_external_javascript.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Internal Script&lt;/h2&gt;
&lt;p&gt;You can write your script code directly into your HTML document. Usually we keep script code in header of the document using &amp;lt;script&amp;gt; tag, otherwise there is no restriction and you can put your source code anywhere in the document but inside &amp;lt;script&amp;gt; tag.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/2VWeMm&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;JavaScript Internal Script&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;base&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://www.tutorialspoint.com/&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/JavaScript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Hello&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Hello, World&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;button&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onclick&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Hello&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;ok&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Click Me&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;

&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result, where you can try to click on the given button &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/internal_script.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Event Handlers&lt;/h2&gt;
&lt;p&gt;Event handlers are nothing but simply defined functions which can be called against any mouse or keyboard event. You can define your business logic inside your event handler which can vary from a single to 1000s of line code.&lt;/p&gt;
&lt;p&gt;Following example explains how to write an event handler. Let&#39;s write one simple function&amp;nbsp;&lt;em&gt;EventHandler()&lt;/em&gt;&amp;nbsp;in the header of the document. We will call this function when any user brings mouse over a paragraph.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/95wwlh&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Event Handlers Example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;base&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;href&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://www.tutorialspoint.com/&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/JavaScript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;EventHandler&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;I&#39;m event handler!!&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onmouseover&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;EventHandler&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Bring your mouse here to see an alert&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;

&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Now This will produce the following result. Bring your mouse over this line and see the result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/event_handler_in_html.htm&quot; width=&quot;600px&quot; height=&quot;100px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Hide Scripts from Older Browsers&lt;/h2&gt;
&lt;p&gt;Although most (if not all) browsers these days support JavaScript, but still some older browsers don&#39;t. If a browser doesn&#39;t support JavaScript, instead of running your script, it would display the code to the user. To prevent this, you can simply place HTML comments around the script as shown below.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;strong&gt;&lt;span class=&quot;typ&quot;&gt;JavaScript&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Example&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;/strong&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;script type &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;text/JavaScript&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Hello JavaScript!&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
   &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;

&lt;strong&gt;&lt;span class=&quot;typ&quot;&gt;VBScript&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Example&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;/strong&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;script type &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;text/vbscript&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Hello VBScript!&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;--&amp;gt;
&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;The &amp;lt;noscript&amp;gt; Element&lt;/h2&gt;
&lt;p&gt;You can also provide alternative info to the users whose browsers don&#39;t support scripts and for those users who have disabled script option their browsers. You can do this using the&amp;nbsp;&lt;strong&gt;&amp;lt;noscript&amp;gt;&lt;/strong&gt;&amp;nbsp;tag.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;strong&gt;&lt;span class=&quot;typ&quot;&gt;JavaScript&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Example&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;/strong&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;script type &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;text/JavaScript&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Hello JavaScript!&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
   &lt;span class=&quot;com&quot;&gt;//--&amp;gt;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;

&lt;span class=&quot;str&quot;&gt;&amp;lt;noscript&amp;gt;&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Your&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; browser does &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;not&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; support &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;JavaScript&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;!&amp;lt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;noscript&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;

&lt;strong&gt;&lt;span class=&quot;typ&quot;&gt;VBScript&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Example&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;/strong&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;script type &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;text/vbscript&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;&amp;lt;!--&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Hello VBScript!&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;--&amp;gt;
&amp;lt;/script&amp;gt;

&amp;lt;noscript&amp;gt;Your browser does not support VBScript!&amp;lt;/noscript&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;Default Scripting Language&lt;/h2&gt;
&lt;p&gt;There may be a situation when you will include multiple script files and ultimately using multiple &amp;lt;script&amp;gt; tags. You can specify a default scripting language for all your&amp;nbsp;&lt;em&gt;script&lt;/em&gt;&amp;nbsp;tags. This saves you from specifying the language every time you use a script tag within the page. Below is the example &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;http-equiv&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Content-Script-Type&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;content&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/JavaScript&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Note that you can still override the default by specifying a language within the script tag&lt;/p&gt;

&lt;h1&gt;Layouts&lt;/h1&gt;
&lt;p&gt;A webpage layout is very important to give better look to your website. It takes considerable time to design a website&#39;s layout with great look and feel.&lt;/p&gt;
&lt;p&gt;Now-a-days, all modern websites are using CSS and JavaScript based framework to come up with responsive and dynamic websites but you can create a good layout using simple HTML tables or division tags in combination with other formatting tags. This chapter will give you few examples on how to create a simple but working layout for your webpage using pure HTML and its attributes.&lt;/p&gt;
&lt;h2&gt;HTML Layout - Using Tables&lt;/h2&gt;
&lt;p&gt;The simplest and most popular way of creating layouts is using HTML &amp;lt;table&amp;gt; tag. These tables are arranged in columns and rows, so you can utilize these rows and columns in whatever way you like.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;For example, the following HTML layout example is achieved using a table with 3 rows and 2 columns but the header and footer column spans both columns using the colspan attribute &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/nsACRm&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Layout using Tables&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;table&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;100%&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;border&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;0&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;colspan&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;2&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;bgcolor&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;#b5dcb3&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is Web Page Main title&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;valign&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;top&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;bgcolor&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;#aaa&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;50&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;b&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Main Menu&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/b&amp;gt;&amp;lt;br&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               HTML&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;br&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               PHP&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;br&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               PERL...
            &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
            
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;bgcolor&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;#eee&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;100&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;height&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;200&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               Technical and Managerial Tutorials
            &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;colspan&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;2&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;bgcolor&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;#b5dcb3&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;center&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  Copyright &amp;copy; 2007 Tutorialspoint.com
               &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/center&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
         
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;

&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/html_layout_using_tables.htm&quot; width=&quot;600px&quot; height=&quot;350px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Multiple Columns Layout - Using Tables&lt;/h2&gt;
&lt;p&gt;You can design your webpage to put your web content in multiple pages. You can keep your content in middle column and you can use left column to use menu and right column can be used to put advertisement or some other stuff. This layout will be very similar to what we have at our website tutorialspoint.com.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Here is an example to create three column layout &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/2dTriq&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Three Column HTML Layout&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;table&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;100%&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;border&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;0&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
         
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;tr&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;valign&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;top&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;bgcolor&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;#aaa&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;20%&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;b&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Main Menu&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/b&amp;gt;&amp;lt;br&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               HTML&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;br&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               PHP&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;br&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               PERL...
            &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
				
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;bgcolor&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;#b5dcb3&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;height&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;200&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;60%&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               Technical and Managerial Tutorials
            &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
				
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;td&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;bgcolor&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;#aaa&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;width&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;20%&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;b&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Right Menu&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/b&amp;gt;&amp;lt;br&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               HTML&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;br&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               PHP&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;br&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               PERL...
            &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
         
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;table&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;

&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/multiple_columns_layout.htm&quot; width=&quot;600px&quot; height=&quot;250px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;HTML Layouts - Using DIV, SPAN&lt;/h2&gt;
&lt;p&gt;The &amp;lt;div&amp;gt; element is a block level element used for grouping HTML elements. While the &amp;lt;div&amp;gt; tag is a block-level element, the HTML &amp;lt;span&amp;gt; element is used for grouping elements at an inline level.&lt;/p&gt;
&lt;p&gt;Although we can achieve pretty nice layouts with HTML tables, but tables weren&#39;t really designed as a layout tool. Tables are more suited to presenting tabular data.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&amp;nbsp;&amp;minus; This example makes use of Cascading Style Sheet (CSS), so before understanding this example you need to have a better understanding on how CSS works.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Here we will try to achieve same result using &amp;lt;div&amp;gt; tag along with CSS, whatever you have achieved using &amp;lt;table&amp;gt; tag in previous example.&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/H9drkJ&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&amp;nbsp;Live Demo&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;dec&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;HTML Layouts using DIV, SPAN&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
		
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:#&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;b5dcb3&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;This is Web Page Main title&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
			
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:#&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;aaa&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; height&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;200px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;100px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&amp;gt;&amp;lt;b&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Main Menu&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/b&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            HTML&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;br&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            PHP&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;br&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            PERL...
         &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
			
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:#&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;eee&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; height&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;200px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;350px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Technical and Managerial Tutorials&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
		
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:#&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;aaa&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; height&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;200px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;100px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&amp;gt;&amp;lt;b&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Right Menu&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/b&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            HTML&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;br&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            PHP&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;br&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            PERL...
         &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
			
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:#&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;b5dcb3&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; clear&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;both&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;center&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
               Copyright &amp;copy; 2007 Tutorialspoint.com
            &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/center&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
			
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;

&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;iframe class=&quot;result&quot; src=&quot;https://www.tutorialspoint.com/html/src/html_using_div_span.htm&quot; width=&quot;600px&quot; height=&quot;350px&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;You can create better layout using DIV, SPAN along with CSS. For more information on CSS, please refer to CSS Tutorial.&lt;/p&gt;
&lt;script&gt;mbtTOC();&lt;/script&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;http://feeds.feedburner.com/PostLinkSharing&lt;/div&gt;</description><link>https://plinksharing.blogspot.com/2021/02/html-learn.html</link><author>noreply@blogger.com (Arakkha Sênâ)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1955839799848409424.post-459412442064148683</guid><pubDate>Fri, 12 Feb 2021 23:42:00 +0000</pubDate><atom:updated>2021-02-12T15:42:09.078-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Firebase</category><category domain="http://www.blogger.com/atom/ns#">Web Programs</category><title>Firebase Guide</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6PcojSYPA-3CVF_kIZJH0NWn_v7cu7W7IacHHfR_ilIaYELImhtYaTTKFQUAt3AGrsvSV5M8cwMws4TyXVVpuoTqB5AIOpaZIPZZ3qu1mKAva1_Z9nyzWMbYjm62dTVl5jEhbygrz1p5W/s0/download.jpeg&quot; style=&quot;display: block; padding: 1em 0; text-align: center; &quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; data-original-height=&quot;150&quot; data-original-width=&quot;337&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6PcojSYPA-3CVF_kIZJH0NWn_v7cu7W7IacHHfR_ilIaYELImhtYaTTKFQUAt3AGrsvSV5M8cwMws4TyXVVpuoTqB5AIOpaZIPZZ3qu1mKAva1_Z9nyzWMbYjm62dTVl5jEhbygrz1p5W/s0/download.jpeg&quot;/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;mbtTOC&quot;&gt;
    &lt;button onclick=&quot;mbtToggle()&quot;&gt;Contents&lt;/button&gt;
    &lt;ol id=&quot;mbtTOC&quot;&gt;&lt;/ol&gt;
    &lt;/div&gt;
&lt;h1&gt;Introduction&lt;/h1&gt;
&lt;p&gt;As per official Firebase documentation &amp;minus;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Firebase can power your app&#39;s backend, including data storage, user authentication, static hosting, and more. Focus on creating extraordinary user experiences. We will take care of the rest. Build cross-platform native mobile and web apps with our Android, iOS, and JavaScript SDKs. You can also connect Firebase to your existing backend using our server-side libraries or our REST API.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;Firebase Features&lt;/h2&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Real-time Database&lt;/strong&gt;&amp;nbsp;&amp;minus; Firebase supports JSON data and all users connected to it receive live updates after every change.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Authentication&lt;/strong&gt;&amp;nbsp;&amp;minus; We can use anonymous, password or different social authentications.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Hosting&lt;/strong&gt;&amp;nbsp;&amp;minus; The applications can be deployed over secured connection to Firebase servers.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Firebase Advantages&lt;/h2&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;It is simple and user friendly. No need for complicated configuration.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The data is real-time, which means that every change will automatically update connected clients.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Firebase offers simple control dashboard.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;There are a number of useful services to choose.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Firebase Limitations&lt;/h2&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;Firebase free plan is limited to 50 Connections and 100 MB of storage.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In the next chapter, we will discuss the environment setup of Firebase.&lt;/p&gt;

&lt;h1&gt;Enviroment Setup&lt;/h1&gt;
&lt;p&gt;In this chapter, we will show you how to add Firebase to the existing application. We will need&amp;nbsp;&lt;strong&gt;NodeJS&lt;/strong&gt;. Check the link from the following table, if you do not have it already.&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Sr.No.&lt;/th&gt;
&lt;th&gt;Software &amp;amp; Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;NodeJS and NPM&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;NodeJS is the platform needed for Firebase development. Checkout our&amp;nbsp;&lt;a href=&quot;https://www.tutorialspoint.com/nodejs/nodejs_environment_setup.htm&quot; target=&quot;_blank&quot;&gt;NodeJS Environment Setup&lt;/a&gt;.&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Step 1 - Create Firebase Account&lt;/h2&gt;
&lt;p&gt;You can create a Firebase account&amp;nbsp;&lt;a href=&quot;https://www.firebase.com/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Step 2 - Create Firebase App&lt;/h2&gt;
&lt;p&gt;You can create new app from the dashboard page. The following image shows the app we created. We can click the&amp;nbsp;&lt;strong&gt;Manage App&lt;/strong&gt;&amp;nbsp;button to enter the app.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/firebase/images/firebase-environment-setup.jpg&quot; alt=&quot;Firebase Environment Setup&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Step 3a - Create basic HTML/js App&lt;/h2&gt;
&lt;p&gt;You just need to create a folder where your app will be placed. Inside that folder, we will need&amp;nbsp;&lt;strong&gt;index.html&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;index.js&lt;/strong&gt;&amp;nbsp;files. We will add Firebase to the header of our app.&lt;/p&gt;
&lt;h3&gt;index.html&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;https://cdn.firebase.com/js/client/2.4.2/firebase.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;index.js&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;Step 3b - Use NPM or Bower&lt;/h2&gt;
&lt;p&gt;If you want to use your existing app, you can use Firebase NPM or Bowers packages. Run one of the following command from your apps root folder.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;npm install firebase --save
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;bower install firebase&lt;/pre&gt;

&lt;h1&gt;Data&lt;/h1&gt;
&lt;p&gt;The Firebase data is representing JSON objects. If you open your app from Firebase dashboard, you can add data manually by clicking on the&amp;nbsp;&lt;strong&gt;+&lt;/strong&gt;&amp;nbsp;sign.&lt;/p&gt;
&lt;p&gt;We will create a simple data structure. You can check the image below.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/firebase/images/firebase-data-simple.jpg&quot; alt=&quot;Firebase Data Simple&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In the previous chapter, we connected Firebase to our app. Now, we can log Firebase to the console.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;firebase&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/firebase/images/firebase-data-log.jpg&quot; alt=&quot;Firebase Data Log&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can create a reference to our player&amp;rsquo;s collection.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;  
&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;ref&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; firebase&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;database&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;players&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We can see the following result in the console.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/firebase/images/firebase-data-players-log.jpg&quot; alt=&quot;Firebase Data Players Log&quot; /&gt;&lt;/p&gt;

&lt;h1&gt;Arrays&lt;/h1&gt;
&lt;p&gt;This chapter will explain the Firebase representation of arrays. We will use the same data from the previous chapter.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/firebase/images/firebase-arrays-simple.jpg&quot; alt=&quot;Firebase Arrays Simple&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We could create this data by sending the following JSON tree to the player&amp;rsquo;s collection.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;[&#39;john&#39;, &#39;amanda&#39;]
&lt;/pre&gt;
&lt;p&gt;This is because Firebase does not support Arrays directly, but it creates a list of objects with integers as key names.&lt;/p&gt;
&lt;p&gt;The reason for not using arrays is because Firebase acts as a real time database and if a couple of users were to manipulate arrays at the same time, the result could be problematic since array indexes are constantly changing.&lt;/p&gt;
&lt;p&gt;The way Firebase handles it, the keys (indexes) will always stay the same. We could delete&amp;nbsp;&lt;strong&gt;john&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;amanda&lt;/strong&gt;&amp;nbsp;would still have the key (index) 1.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/firebase/images/firebase-arrays-changed.jpg&quot; alt=&quot;Firebase Arrays Changed&quot; /&gt;&lt;/p&gt;

&lt;h1&gt;Write Data&lt;/h1&gt;
&lt;p&gt;In this chapter, we will show you how to save your data to Firebase.&lt;/p&gt;
&lt;h2&gt;Set&lt;/h2&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;set&lt;/strong&gt;&amp;nbsp;method will write or replace data on a specified path. Let us create a reference to the player&amp;rsquo;s collection and set two players.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; playersRef &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; firebase&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;database&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;players/&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

playersRef&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;
   &lt;span class=&quot;typ&quot;&gt;John&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      number&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      age&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;30&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;
	
   &lt;span class=&quot;typ&quot;&gt;Amanda&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      number&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      age&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;20&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We will see the following result.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/firebase/images/firebase-write-data-set.jpg&quot; alt=&quot;Firebase Write Data Set&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Update&lt;/h2&gt;
&lt;p&gt;We can update the Firebase data in a similar fashion. Notice how we are using the&amp;nbsp;&lt;strong&gt;players/john&lt;/strong&gt;&amp;nbsp;path.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; johnRef &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; firebase&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;database&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;players/John&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

johnRef&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;update &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&quot;number&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;10&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;When we refresh our app, we can see that the Firebase data is updating.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/firebase/images/firebase-write-data-update.jpg&quot; alt=&quot;Firebase Write Data Update&quot; /&gt;&lt;/p&gt;

&lt;h1&gt;Write List Data&lt;/h1&gt;
&lt;p&gt;In our last chapter, we showed you how to write data in Firebase. Sometimes you need to have a unique identifier for your data. When you want to create unique identifiers for your data, you need to use the push method instead of the set method.&lt;/p&gt;
&lt;h2&gt;The Push Method&lt;/h2&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;push()&lt;/strong&gt;&amp;nbsp;method will create a unique id when the data is pushed. If we want to create our players from the previous chapters with a unique id, we could use the code snippet given below.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;ref&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Firebase&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;https://tutorialsfirebase.firebaseio.com&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; playersRef &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;players&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
playersRef&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;push &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;John&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   number&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   age&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;30&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

playersRef&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;push &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Amanda&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   number&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   age&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;20&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Now our data will look differently. The name will just be a name/value pair like the rest of the properties.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/firebase/images/firebase-write-list-data-push.jpg&quot; alt=&quot;Firebase Write List Data Push&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;The Key Method&lt;/h2&gt;
&lt;p&gt;We can get any key from Firebase by using the&amp;nbsp;&lt;strong&gt;key()&lt;/strong&gt;&amp;nbsp;method. For example, if we want to get our collection name, we could use the following snippet.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;ref&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Firebase&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;https://tutorialsfirebase.firebaseio.com&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; playersRef &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;players&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; playersKey &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; playersRef&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;key&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;playersKey&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The console will log our collection name (players).&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/firebase/images/firebase-write-list-data-key.jpg&quot; alt=&quot;Firebase Write List Data Key&quot; /&gt;&lt;/p&gt;
&lt;p&gt;More on this in our next chapters.&lt;/p&gt;

&lt;h1&gt;Write Transcational Data&lt;/h1&gt;
&lt;p&gt;Transcational data is used when you need to return some data from the database then make some calculation with it and store it back.&lt;/p&gt;
&lt;p&gt;Let us say we have one player inside our player list.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/firebase/images/firebase-write-transactional-data-start.jpg&quot; alt=&quot;Firebase Write Transactional Data Start&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We want to retrieve property, add one year of age and return it back to Firebase.&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;amandaRef&lt;/strong&gt;&amp;nbsp;is retrieving the age from the collection and then we can use the transaction method. We will get the current age, add one year and update the collection.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;ref&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Firebase&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;https://tutorialsfirebase.firebaseio.com&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; amandaAgeRef &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;players&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;-KGb1Ls-gEErWbAMMnZC&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;age&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

amandaAgeRef&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;transaction&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;currentAge&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; currentAge &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;If we run this code, we can see that the age value is updated to&amp;nbsp;&lt;strong&gt;21&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/firebase/images/firebase-write-transactional-data-update.jpg&quot; alt=&quot;Firebase Write Transactional Data Update&quot; /&gt;&lt;/p&gt;

&lt;h1&gt;Read Data&lt;/h1&gt;
&lt;p&gt;In this chapter, we will show you how to read Firebase data. The following image shows the data we want to read.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/firebase/images/firebase_read_data_db.jpg&quot; alt=&quot;Firebase Read Data DB&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can use the&amp;nbsp;&lt;strong&gt;on()&lt;/strong&gt;&amp;nbsp;method to retrieve data. This method is taking the event type as&amp;nbsp;&lt;strong&gt;&quot;value&quot;&lt;/strong&gt;&amp;nbsp;and then retrieves the&amp;nbsp;&lt;strong&gt;snapshot&lt;/strong&gt;&amp;nbsp;of the data. When we add&amp;nbsp;&lt;strong&gt;val()&lt;/strong&gt;&amp;nbsp;method to the snapshot, we will get the JavaScript representation of the data.&lt;/p&gt;
&lt;h2&gt;Example&lt;/h2&gt;
&lt;p&gt;Let us consider the following example.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;ref&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; firebase&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;database&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;value&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;snapshot&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;snapshot&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Error: &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;code&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;If we run the following code, our console will show the data.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/firebase/images/firebase_read_data_log.jpg&quot; alt=&quot;Firebase Read Data Log&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In our next chapter, we will explain other event types that you can use for reading data.&lt;/p&gt;

&lt;h1&gt;Event Types&lt;/h1&gt;
&lt;p&gt;Firebase offers several different event types for reading data. Some of the most commonly used ones are described below.&lt;/p&gt;
&lt;h2&gt;value&lt;/h2&gt;
&lt;p&gt;The first event type is&amp;nbsp;&lt;strong&gt;value&lt;/strong&gt;. We showed you how to use value in our last chapter. This event type will be triggered every time the data changes and it will retrieve all the data including children.&lt;/p&gt;
&lt;h2&gt;child_added&lt;/h2&gt;
&lt;p&gt;This event type will be triggered once for every player and every time a new player is added to our data. It is useful for reading list data because we get access of the added player and previous player from the list.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Let us consider the following example.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; playersRef &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; firebase&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;database&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;players/&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

playersRef&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;child_added&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; prevChildKey&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; newPlayer &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;name: &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; newPlayer&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;age: &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; newPlayer&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;age&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;number: &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; newPlayer&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;number&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Previous Player: &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; prevChildKey&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We will get the following result.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/firebase/images/firebase_event_types_child_added_log.jpg&quot; alt=&quot;Event Type Child Added Log&quot; /&gt;&lt;/p&gt;
&lt;p&gt;If we add a new player named Bob, we will get the updated data.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/firebase/images/firebase_event_types_child_added_updated_log.jpg&quot; alt=&quot;Event Type Child Added Updated Log&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;child_changed&lt;/h2&gt;
&lt;p&gt;This event type is triggered when the data has changed.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Let us consider the following example.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; playersRef &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; firebase&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;database&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;players/&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

playersRef&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;child_changed&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; player &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;The updated player name is &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; player&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We can change&amp;nbsp;&lt;strong&gt;Bob&lt;/strong&gt;&amp;nbsp;to&amp;nbsp;&lt;strong&gt;Maria&lt;/strong&gt;&amp;nbsp;in Firebase to get the update.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/firebase/images/firebase_event_types_child_changed_log.jpg&quot; alt=&quot;Event Type Child Changed Log&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;child_removed&lt;/h2&gt;
&lt;p&gt;If we want to get access of deleted data, we can use&amp;nbsp;&lt;strong&gt;child_removed&lt;/strong&gt;&amp;nbsp;event type.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; playersRef &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; firebase&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;database&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;players/&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

playersRef&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;child_removed&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; deletedPlayer &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;deletedPlayer&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot; has been deleted&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Now, we can delete Maria from Firebase to get notifications.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/firebase/images/firebase_event_types_child_deleted_log.jpg&quot; alt=&quot;Event Type Child Deleted Log&quot; /&gt;&lt;/p&gt;

&lt;h1&gt;Detaching Callbacks&lt;/h1&gt;
&lt;p&gt;This chapter will show you how to detach callbacks in Firebase.&lt;/p&gt;
&lt;h2&gt;Detach Callback for Event Type&lt;/h2&gt;
&lt;p&gt;Let us say we want to detach a callback for a function with&amp;nbsp;&lt;strong&gt;value&lt;/strong&gt;&amp;nbsp;event type.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranlsate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; playersRef &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; firebase&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;database&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;players/&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;value&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Error: &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;code&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We need to use&amp;nbsp;&lt;strong&gt;off()&lt;/strong&gt;&amp;nbsp;method. This will remove all callbacks with&amp;nbsp;&lt;strong&gt;value&lt;/strong&gt;&amp;nbsp;event type.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;playersRef.off(&quot;value&quot;);
&lt;/pre&gt;
&lt;h2&gt;Detach All Callbacks&lt;/h2&gt;
&lt;p&gt;When we want to detach all callbacks, we can use &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;playersRef.off();&lt;/pre&gt;

&lt;h1&gt;Queries&lt;/h1&gt;
&lt;p&gt;Firebase offers various ways of ordering data. In this chapter, we will show simple query examples. We will use the same data from our previous chapters.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/firebase/images/firebase_queries_data.jpg&quot; alt=&quot;Firebase Queries Data&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Order by Child&lt;/h2&gt;
&lt;p&gt;To order data by name, we can use the following code.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Let us consider the following example.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; playersRef &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; firebase&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;database&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;players/&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

playersRef&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;orderByChild&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;child_added&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We will see names in the alphabetic order.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/firebase/images/firebase_queries_order_by_child.jpg&quot; alt=&quot;Firebase Queries Order By Child&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Order by Key&lt;/h2&gt;
&lt;p&gt;We can order data by key in a similar fashion.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Let us consider the following example.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; playersRef &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; firebase&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;database&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;players/&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

playersRef&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;orderByKey&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;child_added&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;key&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The output will be as shown below.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/firebase/images/firebase_queries_order_by_key.jpg&quot; alt=&quot;Firebase Queries Order By Key&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Order by Value&lt;/h2&gt;
&lt;p&gt;We can also order data by value. Let us add the ratings collection in Firebase.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/firebase/images/firebase_queries_rating_data.jpg&quot; alt=&quot;Firebase Queries Rating Data&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now we can order data by value for each player.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Let us consider the following example.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; ratingRef &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; firebase&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;database&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;ratings/&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

ratingRef&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;orderByValue&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;value&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   
   data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;forEach&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;The &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;key &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot; rating is &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
   
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The output will be as shown below.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/firebase/images/firebase_queries_rating_log.jpg&quot; alt=&quot;Firebase Queries Rating Log&quot; /&gt;&lt;/p&gt;

&lt;h1&gt;Filtering&lt;/h1&gt;
&lt;p&gt;Firebase offers several ways to filter data.&lt;/p&gt;
&lt;h2&gt;Limit to First and Last&lt;/h2&gt;
&lt;p&gt;Let us understand what limit to first and last is.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;limitToFirst&lt;/strong&gt;&amp;nbsp;method returns the specified number of items beginning from the first one.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;limitToLast&lt;/strong&gt;&amp;nbsp;method returns a specified number of items beginning from the last one.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Our example is showing how this works. Since we only have two players in database, we will limit queries to one player.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Let us consider the following example.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; firstPlayerRef &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; firebase&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;database&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;players/&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;limitToFirst&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; lastPlayerRef &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; firebase&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;database&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;players/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;limitToLast&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

firstPlayerRef&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;value&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Error: &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;code&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

lastPlayerRef&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;value&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;());&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Error: &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;code&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Our console will log the first player from the first query, and the last player from the second query.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/firebase/images/firebse_filtering_data_limit_to_first_last.jpg&quot; alt=&quot;Firebase Filtering Data Limit to First Last&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Other Filters&lt;/h2&gt;
&lt;p&gt;We can also use other Firebase filtering methods. The&amp;nbsp;&lt;strong&gt;startAt()&lt;/strong&gt;,&amp;nbsp;&lt;strong&gt;endAt()&lt;/strong&gt;&amp;nbsp;and the&amp;nbsp;&lt;strong&gt;equalTo()&lt;/strong&gt;&amp;nbsp;can be combined with ordering methods. In our example, we will combine it with the&amp;nbsp;&lt;strong&gt;orderByChild()&lt;/strong&gt;&amp;nbsp;method.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Let us consider the following example.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; playersRef &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; firebase&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;database&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;players/&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

playersRef&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;orderByChild&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;startAt&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Amanda&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;child_added&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Start at filter: &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

playersRef&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;orderByChild&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;endAt&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Amanda&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;child_added&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;End at filter: &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

playersRef&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;orderByChild&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;equalTo&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;John&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;child_added&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Equal to filter: &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

playersRef&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;orderByChild&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;age&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;startAt&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;child_added&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Age filter: &quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The first query will order elements by name and filter from the player with the name&amp;nbsp;&lt;strong&gt;Amanda&lt;/strong&gt;. The console will log both players. The second query will log &quot;Amanda&quot; since we are ending query with this name. The third one will log &quot;John&quot; since we are searching for a player with that name.&lt;/p&gt;
&lt;p&gt;The fourth example is showing how we can combine filters with &quot;age&quot; value. Instead of string, we are passing the number inside the&amp;nbsp;&lt;strong&gt;startAt()&lt;/strong&gt;&amp;nbsp;method since age is represented by a number value.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/firebase/images/firebase_filtering_data_start_end_equal.jpg&quot; alt=&quot;Firebase Filtering Data Start End Equal&quot; /&gt;&lt;/p&gt;

&lt;h1&gt;Email Authentication&lt;/h1&gt;
&lt;p&gt;In this chapter, we will show you how to use Firebase Email/Password authentication.&lt;/p&gt;
&lt;h2&gt;Create user&lt;/h2&gt;
&lt;p&gt;To authenticate a user, we can use the&amp;nbsp;&lt;strong&gt;createUserWithEmailAndPassword(email, password)&lt;/strong&gt;&amp;nbsp;method.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Let us consider the following example.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; email &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;myemail@email.com&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; password &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;mypassword&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

firebase&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;auth&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;createUserWithEmailAndPassword&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;email&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; password&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;code&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We can check the Firebase dashboard and see that the user is created.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/firebase/images/firebase_email_authentication_user.jpg&quot; alt=&quot;Firebase Email Authentication User&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Sign In&lt;/h2&gt;
&lt;p&gt;The Sign-in process is almost the same. We are using the&amp;nbsp;&lt;strong&gt;signInWithEmailAndPassword(email, password)&lt;/strong&gt;&amp;nbsp;to sign in the user.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Let us consider the following example.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; email &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;myemail@email.com&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; password &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;mypassword&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

firebase&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;auth&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;signInWithEmailAndPassword&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;email&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; password&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;code&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;Signout&lt;/h2&gt;
&lt;p&gt;And finally we can logout the user with the&amp;nbsp;&lt;strong&gt;signOut()&lt;/strong&gt;&amp;nbsp;method.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Let us consider the following example.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;firebase&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;auth&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;signOut&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;then&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Logged out!&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;code&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;

&lt;h1&gt;Google Authentication&lt;/h1&gt;
&lt;p&gt;n this chapter, we will show you how to set up Google authentication in Firebase.&lt;/p&gt;
&lt;h2&gt;Step 1 - Enable Google Authentication&lt;/h2&gt;
&lt;p&gt;Open Firebase dashboard and click&amp;nbsp;&lt;strong&gt;Auth&lt;/strong&gt;&amp;nbsp;on the left side menu. To open the list of available methods, you need to click on&amp;nbsp;&lt;strong&gt;SIGN_IN_METHODS&lt;/strong&gt;&amp;nbsp;in the tab menu.&lt;/p&gt;
&lt;p&gt;Now you can choose&amp;nbsp;&lt;strong&gt;Google&lt;/strong&gt;&amp;nbsp;from the list, enable it and save it.&lt;/p&gt;
&lt;h2&gt;Step 2 - Create Buttons&lt;/h2&gt;
&lt;p&gt;Inside our&amp;nbsp;&lt;strong&gt;index.html&lt;/strong&gt;, we will add two buttons.&lt;/p&gt;
&lt;h3&gt;index.html&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onclick&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;googleSignin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Google Signin&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onclick&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;googleSignout&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Google Signout&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;Step 3 - Signin and Signout&lt;/h2&gt;
&lt;p&gt;In this step, we will create Signin and Signout functions. We will use&amp;nbsp;&lt;strong&gt;signInWithPopup()&lt;/strong&gt;and&amp;nbsp;&lt;strong&gt;signOut()&lt;/strong&gt;&amp;nbsp;methods.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Let us consider the following example.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; provider &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; firebase&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;auth&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;GoogleAuthProvider&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; googleSignin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   firebase&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;auth&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;
   
   &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;signInWithPopup&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;provider&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;then&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; token &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;credential&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;accessToken&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; user &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
		
      console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;token&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}).&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; errorCode &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;code&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; errorMessage &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
		
      console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;code&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; googleSignout&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   firebase&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;auth&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;signOut&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;
	
   &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;then&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Signout Succesfull&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Signout Failed&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;  
   &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;After we refresh the page, we can click on the&amp;nbsp;&lt;strong&gt;Google Signin&lt;/strong&gt;&amp;nbsp;button to trigger the Google popup. If signing in is successful, the developer console will log in our user.&lt;/p&gt;
&lt;p&gt;We can also click on the&amp;nbsp;&lt;strong&gt;Google Signout&lt;/strong&gt;&amp;nbsp;button to logout from the app. The console will confirm that the logout was successful.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/firebase/images/firebase_google_auth_log.jpg&quot; alt=&quot;Firebase Google Auth Log&quot; /&gt;&lt;/p&gt;

&lt;h1&gt;Facebook Authentication&lt;/h1&gt;
&lt;p&gt;In this chapter, we will authenticate users with Firebase Facebook authentication.&lt;/p&gt;
&lt;h2&gt;Step 1 - Enable Facebook Auth&lt;/h2&gt;
&lt;p&gt;We need to open Firebase dashboard and click&amp;nbsp;&lt;strong&gt;Auth&lt;/strong&gt;&amp;nbsp;in side menu. Next, we need to choose&amp;nbsp;&lt;strong&gt;SIGN-IN-METHOD&lt;/strong&gt;&amp;nbsp;in tab bar. We will enable Facebook auth and leave this open since we need to add&amp;nbsp;&lt;strong&gt;App ID&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;App Secret&lt;/strong&gt;&amp;nbsp;when we finish step 2.&lt;/p&gt;
&lt;h2&gt;Step 2 - Create Facebook App&lt;/h2&gt;
&lt;p&gt;To enable Facebook authentication, we need to create the Facebook app. Click on&amp;nbsp;&lt;a href=&quot;https://developers.facebook.com/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;this link&lt;/a&gt;&amp;nbsp;to start. Once the app is created, we need to copy&amp;nbsp;&lt;strong&gt;App ID&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;App Secret&lt;/strong&gt;&amp;nbsp;to the Firebase page, which we left open in step 1. We also need to copy&amp;nbsp;&lt;strong&gt;OAuth Redirect URI&lt;/strong&gt;from this window into the Facebook app. You can find&amp;nbsp;&lt;strong&gt;+ Add Product&lt;/strong&gt;&amp;nbsp;inside side menu of the Facebook app dashboard.&lt;/p&gt;
&lt;p&gt;Choose&amp;nbsp;&lt;strong&gt;Facebook Login&lt;/strong&gt;&amp;nbsp;and it will appear in the side menu. You will find input field&amp;nbsp;&lt;strong&gt;Valid OAuth redirect URIs&lt;/strong&gt;&amp;nbsp;where you need to copy the&amp;nbsp;&lt;strong&gt;OAuth Redirect URI&lt;/strong&gt;&amp;nbsp;from Firebase.&lt;/p&gt;
&lt;h2&gt;Step 3 - Connect to Facebook SDK&lt;/h2&gt;
&lt;p&gt;Copy the following code at the beginning of the&amp;nbsp;&lt;strong&gt;body&lt;/strong&gt;&amp;nbsp;tag in&amp;nbsp;&lt;strong&gt;index.html&lt;/strong&gt;. Be sure to replace the&amp;nbsp;&lt;strong&gt;&#39;APP_ID&#39;&lt;/strong&gt;&amp;nbsp;to your app id from Facebook dashboard.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Let us consider the following example.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;script&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   window&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;fbAsyncInit &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      FB&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;init &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         appId      &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;APP_ID&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         xfbml      &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         version    &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;v2.6&#39;&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;};&lt;/span&gt;

   &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; s&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; id&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; js&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; fjs &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; d&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;getElementsByTagName&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;];&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;getElementById&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      js &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; d&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;createElement&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; js&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;id &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; id&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      js&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;src &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;//connect.facebook.net/en_US/sdk.js&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      fjs&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;insertBefore&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;js&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; fjs&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;script&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;facebook-jssdk&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;));&lt;/span&gt;
	
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;Step 4 - Create Buttons&lt;/h2&gt;
&lt;p&gt;We set everything in first three steps, now we can create two buttons for login and logout.&lt;/p&gt;
&lt;h3&gt;index.html&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onclick&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;facebookSignin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Facebook Signin&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onclick&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;facebookSignout&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Facebook Signout&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;Step 5 - Create Auth Functions&lt;/h2&gt;
&lt;p&gt;This is the last step. Open&amp;nbsp;&lt;strong&gt;index.js&lt;/strong&gt;&amp;nbsp;and copy the following code.&lt;/p&gt;
&lt;h3&gt;index.js&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; provider &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; firebase&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;auth&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;FacebookAuthProvider&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; facebookSignin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   firebase&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;auth&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;signInWithPopup&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;provider&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
   
   &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;then&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; token &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;credential&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;accessToken&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; user &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; result&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
		
      console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;token&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}).&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;code&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; facebookSignout&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   firebase&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;auth&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;signOut&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;
   
   &lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;then&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Signout successful!&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Signout failed&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;

&lt;h1&gt;Offline&lt;/h1&gt;
&lt;p&gt;In this chapter, we will show you how to handle the Firebase connection state.&lt;/p&gt;
&lt;h2&gt;Check Connection&lt;/h2&gt;
&lt;p&gt;We can check for connection value using the following code.&lt;/p&gt;
&lt;h3&gt;index.js&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; connectedRef &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; firebase&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;database&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;.info/connected&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

connectedRef&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;value&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;snap&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;snap&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;===&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;connected&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;not connected&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;When we run the app, the pop up will inform us about the connection.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/firebase/images/firebase_offline_popup.jpg&quot; alt=&quot;Firebase Offline Popup&quot; /&gt;&lt;/p&gt;
&lt;p&gt;By using the above given function, you can keep a track of the connection state and update your app accordingly.&lt;/p&gt;

&lt;h1&gt;Security&lt;/h1&gt;
&lt;p&gt;Security in Firebase is handled by setting the JSON like object inside the security rules. Security rules can be found when we click on&amp;nbsp;&lt;strong&gt;Database&lt;/strong&gt;&amp;nbsp;inside the side menu and then&amp;nbsp;&lt;strong&gt;RULES&lt;/strong&gt;&amp;nbsp;in tab bar.&lt;/p&gt;
&lt;p&gt;In this chapter, we will go through a couple of simple examples to show you how to secure the Firebase data.&lt;/p&gt;
&lt;h2&gt;Read and Write&lt;/h2&gt;
&lt;p&gt;The following code snippet defined inside the Firebase security rules will allow writing access to&amp;nbsp;&lt;strong&gt;/users/&#39;$uid&#39;/&lt;/strong&gt;&amp;nbsp;for the authenticated user with the same&amp;nbsp;&lt;strong&gt;uid&lt;/strong&gt;, but everyone could read it.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;p&gt;Let us consider the following example.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&quot;rules&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;str&quot;&gt;&quot;users&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
         
         &lt;span class=&quot;str&quot;&gt;&quot;$uid&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;str&quot;&gt;&quot;.write&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;$uid === auth.uid&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;str&quot;&gt;&quot;.read&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;
         &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
         
      &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;Validate&lt;/h2&gt;
&lt;p&gt;We can enforce data to string by using the following example.&lt;/p&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&quot;rules&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      
      &lt;span class=&quot;str&quot;&gt;&quot;foo&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
         &lt;span class=&quot;str&quot;&gt;&quot;.validate&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;newData.isString()&quot;&lt;/span&gt;
      &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
      
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This chapter only grabbed the surface of Firebase security rules. The important thing is to understand how these rules work, so you can combine it inside the app.&lt;/p&gt;

&lt;h1&gt;Deploying&lt;/h1&gt;
&lt;p&gt;In this chapter, we will show you how to host your app on the Firebase server.&lt;/p&gt;
&lt;p&gt;Before we begin, let us just add some text to&amp;nbsp;&lt;strong&gt;index.html&lt;/strong&gt;&amp;nbsp;body tag. In this example, we will add the following text.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;WELCOME TO FIREBASE TUTORIALS APP&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;Step 1 - Install Firebase Tools&lt;/h2&gt;
&lt;p&gt;We need to install firebase tools globally in the&amp;nbsp;&lt;strong&gt;command prompt&lt;/strong&gt;&amp;nbsp;window.&lt;/p&gt;
&lt;pre class=&quot;result notranlsate&quot;&gt;npm install -g firebase-tools
&lt;/pre&gt;
&lt;h2&gt;Step 2 - Initialize the Firebase App&lt;/h2&gt;
&lt;p&gt;First we need to login to Firebase in the&amp;nbsp;&lt;strong&gt;command prompt&lt;/strong&gt;.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;firebase login
&lt;/pre&gt;
&lt;p&gt;Open the root folder of your app in the&amp;nbsp;&lt;strong&gt;command prompt&lt;/strong&gt;&amp;nbsp;and run the following command.&lt;/p&gt;
&lt;pre class=&quot;result notranlsate&quot;&gt;firebase init
&lt;/pre&gt;
&lt;p&gt;This command will initialize your app.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;&amp;nbsp;&amp;minus; If you have used a default configuration, the&amp;nbsp;&lt;strong&gt;public&lt;/strong&gt;&amp;nbsp;folder will be created and the&amp;nbsp;&lt;strong&gt;index.html&lt;/strong&gt;&amp;nbsp;inside this folder will be the starting point of your app. You can copy your app file inside the public folder as a workaround.&lt;/p&gt;
&lt;h2&gt;Step 3 - Deploy Firebase App&lt;/h2&gt;
&lt;p&gt;This is the last step in this chapter. Run the following command from the&amp;nbsp;&lt;strong&gt;command prompt&lt;/strong&gt;&amp;nbsp;to deploy your app.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;firebase deploy
&lt;/pre&gt;
&lt;p&gt;After this step, the console will log your apps Firebase URL. In our case, it is called&amp;nbsp;&lt;a href=&quot;https://tutorialsfirebase.firebaseapp.com/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://tutorialsfirebase.firebaseapp.com&lt;/a&gt;. We can run this link in the browser to see our app.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/firebase/images/firebase_deploying.jpg&quot; alt=&quot;Firebase Deploying&quot; /&gt;&lt;/p&gt;
&lt;script&gt;mbtTOC();&lt;/script&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;http://feeds.feedburner.com/PostLinkSharing&lt;/div&gt;</description><link>https://plinksharing.blogspot.com/2021/02/firebase-guide.html</link><author>noreply@blogger.com (Arakkha Sênâ)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6PcojSYPA-3CVF_kIZJH0NWn_v7cu7W7IacHHfR_ilIaYELImhtYaTTKFQUAt3AGrsvSV5M8cwMws4TyXVVpuoTqB5AIOpaZIPZZ3qu1mKAva1_Z9nyzWMbYjm62dTVl5jEhbygrz1p5W/s72-c/download.jpeg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1955839799848409424.post-1652612827319323169</guid><pubDate>Fri, 12 Feb 2021 16:22:00 +0000</pubDate><atom:updated>2021-02-12T08:22:23.170-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Django</category><category domain="http://www.blogger.com/atom/ns#">Web Programs</category><title>DJANGO</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiq8nRE8KuGeEydAHCiIiMd4kOPYvv41E7TS1P0itun5D7s6ywbJRsO8yFUc_F3JKT3EbdjUZTdgln5uncQrKLfd__ou9X_n7NsJTj7tUXbPXKZQLO5fqPdh8fboiBvm5u-CKGKBiTywq7l/s0/images.jpeg&quot; style=&quot;display: block; padding: 1em 0; text-align: center; &quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; data-original-height=&quot;136&quot; data-original-width=&quot;370&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiq8nRE8KuGeEydAHCiIiMd4kOPYvv41E7TS1P0itun5D7s6ywbJRsO8yFUc_F3JKT3EbdjUZTdgln5uncQrKLfd__ou9X_n7NsJTj7tUXbPXKZQLO5fqPdh8fboiBvm5u-CKGKBiTywq7l/s0/images.jpeg&quot;/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;mbtTOC&quot;&gt;
    &lt;button onclick=&quot;mbtToggle()&quot;&gt;Contents&lt;/button&gt;
    &lt;ol id=&quot;mbtTOC&quot;&gt;&lt;/ol&gt;
    &lt;/div&gt;
&lt;h1&gt;Introduction&lt;/h1&gt;
&lt;p&gt;As you already know, Django is a Python web framework. And like most modern framework, Django supports the MVC pattern. First let&#39;s see what is the Model-View-Controller (MVC) pattern, and then we will look at Django&amp;rsquo;s specificity for the Model-View-Template (MVT) pattern.&lt;/p&gt;
&lt;h2&gt;MVC Pattern&lt;/h2&gt;
&lt;p&gt;When talking about applications that provides UI (web or desktop), we usually talk about MVC architecture. And as the name suggests, MVC pattern is based on three components: Model, View, and Controller.&amp;nbsp;&lt;a href=&quot;http://www.tutorialspoint.com/struts_2/basic_mvc_architecture.htm&quot;&gt;Check our MVC tutorial here&lt;/a&gt;&amp;nbsp;to know more.&lt;/p&gt;
&lt;h2&gt;DJANGO MVC - MVT Pattern&lt;/h2&gt;
&lt;p&gt;The Model-View-Template (MVT) is slightly different from MVC. In fact the main difference between the two patterns is that Django itself takes care of the Controller part (Software Code that controls the interactions between the Model and View), leaving us with the template. The template is a HTML file mixed with Django Template Language (DTL).&lt;/p&gt;
&lt;p&gt;The following diagram illustrates how each of the components of the MVT pattern interacts with each other to serve a user request &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/django_mvc_mvt_pattern.jpg&quot; alt=&quot;DJANGO MVC - MVT Pattern&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The developer provides the Model, the view and the template then just maps it to a URL and Django does the magic to serve it to the user.&lt;/p&gt;

&lt;h1&gt;Environment&lt;/h1&gt;
&lt;p&gt;Django development environment consists of installing and setting up Python, Django, and a Database System. Since Django deals with web application, it&#39;s worth mentioning that you would need a web server setup as well.&lt;/p&gt;
&lt;h2&gt;Step 1 &amp;ndash; Installing Python&lt;/h2&gt;
&lt;p&gt;Django is written in 100% pure Python code, so you&#39;ll need to install Python on your system. Latest Django version requires Python 2.6.5 or higher&lt;/p&gt;
&lt;p&gt;If you&#39;re on one of the latest Linux or Mac OS X distribution, you probably already have Python installed. You can verify it by typing&amp;nbsp;&lt;em&gt;python&lt;/em&gt;&amp;nbsp;command at a command prompt. If you see something like this, then Python is installed.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;$ python
Python 2.7.5 (default, Jun 17 2014, 18:11:42)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on linux2
&lt;/pre&gt;
&lt;p&gt;Otherwise, you can download and install the latest version of Python from the link&amp;nbsp;&lt;a href=&quot;https://www.python.org/downloads/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://www.python.org/download&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Step 2 - Installing Django&lt;/h2&gt;
&lt;p&gt;Installing Django is very easy, but the steps required for its installation depends on your operating system. Since Python is a platform-independent language, Django has one package that works everywhere regardless of your operating system.&lt;/p&gt;
&lt;p&gt;You can download the latest version of Django from the link&amp;nbsp;&lt;a href=&quot;https://www.djangoproject.com/download/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://www.djangoproject.com/download&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;UNIX/Linux and Mac OS X Installation&lt;/h3&gt;
&lt;p&gt;You have two ways of installing Django if you are running Linux or Mac OS system &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;You can use the package manager of your OS, or use easy_install or pip if installed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Install it manually using the official archive you downloaded before.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We will cover the second option as the first one depends on your OS distribution. If you have decided to follow the first option, just be careful about the version of Django you are installing.&lt;/p&gt;
&lt;p&gt;Let&#39;s say you got your archive from the link above, it should be something like Django-x.xx.tar.gz:&lt;/p&gt;
&lt;p&gt;Extract and install.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;$ tar xzvf Django-x.xx.tar.gz
$ cd Django-x.xx
$ sudo python setup.py install
&lt;/pre&gt;
&lt;p&gt;You can test your installation by running this command &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;$ django-admin.py --version
&lt;/pre&gt;
&lt;p&gt;If you see the current version of Django printed on the screen, then everything is set.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&amp;nbsp;&amp;minus; For some version of Django it will be django-admin the &quot;.py&quot; is removed.&lt;/p&gt;
&lt;h3&gt;Windows Installation&lt;/h3&gt;
&lt;p&gt;We assume you have your Django archive and python installed on your computer.&lt;/p&gt;
&lt;p&gt;First, PATH verification.&lt;/p&gt;
&lt;p&gt;On some version of windows (windows 7) you might need to make sure the Path system variable has the path the following&amp;nbsp;&lt;code&gt;C:\Python34\;C:\Python34\Lib\site-packages\django\bin\&lt;/code&gt;&amp;nbsp;in it, of course depending on your Python version.&lt;/p&gt;
&lt;p&gt;Then, extract and install Django.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;c:\&amp;gt;cd c:\Django-x.xx
&lt;/pre&gt;
&lt;p&gt;Next, install Django by running the following command for which you will need administrative privileges in windows shell &quot;cmd&quot; &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;c:\Django-x.xx&amp;gt;python setup.py install
&lt;/pre&gt;
&lt;p&gt;To test your installation, open a command prompt and type the following command &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;c:\&amp;gt;python -c &quot;import django; print(django.get_version())&quot;
&lt;/pre&gt;
&lt;p&gt;If you see the current version of Django printed on screen, then everything is set.&lt;/p&gt;
&lt;p&gt;OR&lt;/p&gt;
&lt;p&gt;Launch a &quot;cmd&quot; prompt and type python then &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;c:\&amp;gt; python
&amp;gt;&amp;gt;&amp;gt; import django
&amp;gt;&amp;gt;&amp;gt; django.VERSION
&lt;/pre&gt;
&lt;h2&gt;Step 3 &amp;ndash; Database Setup&lt;/h2&gt;
&lt;p&gt;Django supports several major database engines and you can set up any of them based on your comfort.&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://www.mysql.com/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;MySQL (http://www.mysql.com/)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.postgresql.org/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;PostgreSQL (http://www.postgresql.org/)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.sqlite.org/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;SQLite 3 (http://www.sqlite.org/)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.oracle.com/index.html&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;Oracle (http://www.oracle.com/)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://django-mongodb-engine.readthedocs.org/en/latest/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;MongoDb (https://django-mongodb-engine.readthedocs.org)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://cloud.google.com/appengine/articles/django-nonrel&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;GoogleAppEngine Datastore (https://cloud.google.com/appengine/articles/django-nonrel)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can refer to respective documentation to installing and configuring a database of your choice.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&amp;nbsp;&amp;minus; Number 5 and 6 are NoSQL databases.&lt;/p&gt;
&lt;h2&gt;Step 4 &amp;ndash; Web Server&lt;/h2&gt;
&lt;p&gt;Django comes with a lightweight web server for developing and testing applications. This server is pre-configured to work with Django, and more importantly, it restarts whenever you modify the code.&lt;/p&gt;
&lt;p&gt;However, Django does support Apache and other popular web servers such as Lighttpd. We will discuss both the approaches in coming chapters while working with different examples.&lt;/p&gt;

&lt;h1&gt;Creating A Project&lt;/h1&gt;
&lt;p&gt;Now that we have installed Django, let&#39;s start using it. In Django, every web app you want to create is called a project; and a project is a sum of applications. An application is a set of code files relying on the MVT pattern. As example let&#39;s say we want to build a website, the website is our project and, the forum, news, contact engine are applications. This structure makes it easier to move an application between projects since every application is independent.&lt;/p&gt;
&lt;h2&gt;Create a Project&lt;/h2&gt;
&lt;p&gt;Whether you are on Windows or Linux, just get a terminal or a&amp;nbsp;&lt;strong&gt;cmd&lt;/strong&gt;&amp;nbsp;prompt and navigate to the place you want your project to be created, then use this code &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;$ django-admin startproject myproject
&lt;/pre&gt;
&lt;p&gt;This will create a &quot;myproject&quot; folder with the following structure &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;myproject/
   manage.py
   myproject/
      __init__.py
      settings.py
      urls.py
      wsgi.py
&lt;/pre&gt;
&lt;h2&gt;The Project Structure&lt;/h2&gt;
&lt;p&gt;The &amp;ldquo;myproject&amp;rdquo; folder is just your project container, it actually contains two elements &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;manage.py&lt;/strong&gt;&amp;nbsp;&amp;minus; This file is kind of your project local django-admin for interacting with your project via command line (start the development server, sync db...). To get a full list of command accessible via manage.py you can use the code &amp;minus;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;$ python manage.py help
&lt;/pre&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;The &amp;ldquo;myproject&amp;rdquo; subfolder&lt;/strong&gt;&amp;nbsp;&amp;minus; This folder is the actual python package of your project. It contains four files &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;__init__.py&lt;/strong&gt;&amp;nbsp;&amp;minus; Just for python, treat this folder as package.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;settings.py&lt;/strong&gt;&amp;nbsp;&amp;minus; As the name indicates, your project settings.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;urls.py&lt;/strong&gt;&amp;nbsp;&amp;minus; All links of your project and the function to call. A kind of ToC of your project.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;wsgi.py&lt;/strong&gt;&amp;nbsp;&amp;minus; If you need to deploy your project over WSGI.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Setting Up Your Project&lt;/h2&gt;
&lt;p&gt;Your project is set up in the subfolder myproject/settings.py. Following are some important options you might need to set &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;DEBUG = True
&lt;/pre&gt;
&lt;p&gt;This option lets you set if your project is in debug mode or not. Debug mode lets you get more information about your project&#39;s error. Never set it to &amp;lsquo;True&amp;rsquo; for a live project. However, this has to be set to &amp;lsquo;True&amp;rsquo; if you want the Django light server to serve static files. Do it only in the development mode.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;DATABASES &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;default&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;str&quot;&gt;&#39;ENGINE&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;django.db.backends.sqlite3&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;str&quot;&gt;&#39;NAME&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;database.sql&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;str&quot;&gt;&#39;USER&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;str&quot;&gt;&#39;PASSWORD&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;str&quot;&gt;&#39;HOST&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;str&quot;&gt;&#39;PORT&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Database is set in the &amp;lsquo;Database&amp;rsquo; dictionary. The example above is for SQLite engine. As stated earlier, Django also supports &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;MySQL (django.db.backends.mysql)&lt;/li&gt;
&lt;li&gt;PostGreSQL (django.db.backends.postgresql_psycopg2)&lt;/li&gt;
&lt;li&gt;Oracle (django.db.backends.oracle) and NoSQL DB&lt;/li&gt;
&lt;li&gt;MongoDB (django_mongodb_engine)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Before setting any new engine, make sure you have the correct db driver installed.&lt;/p&gt;
&lt;p&gt;You can also set others options like: TIME_ZONE, LANGUAGE_CODE, TEMPLATE&amp;hellip;&lt;/p&gt;
&lt;p&gt;Now that your project is created and configured make sure it&#39;s working &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;$ python manage.py runserver
&lt;/pre&gt;
&lt;p&gt;You will get something like the following on running the above code &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;Validating models...

0 errors found
September 03, 2015 - 11:41:50
Django version 1.6.11, using settings &#39;myproject.settings&#39;
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.&lt;/pre&gt;

&lt;h1&gt;App Lifecycle&lt;/h1&gt;
&lt;p&gt;A project is a sum of many applications. Every application has an objective and can be reused into another project, like the contact form on a website can be an application, and can be reused for others. See it as a module of your project.&lt;/p&gt;
&lt;h2&gt;Create an Application&lt;/h2&gt;
&lt;p&gt;We assume you are in your project folder. In our main &amp;ldquo;myproject&amp;rdquo; folder, the same folder then manage.py &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;$ python manage.py startapp myapp
&lt;/pre&gt;
&lt;p&gt;You just created myapp application and like project, Django create a &amp;ldquo;myapp&amp;rdquo; folder with the application structure &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;myapp/
   __init__.py
   admin.py
   models.py
   tests.py
   views.py
&lt;/pre&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;__init__.py&lt;/strong&gt;&amp;nbsp;&amp;minus; Just to make sure python handles this folder as a package.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;admin.py&lt;/strong&gt;&amp;nbsp;&amp;minus; This file helps you make the app modifiable in the admin interface.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;models.py&lt;/strong&gt;&amp;nbsp;&amp;minus; This is where all the application models are stored.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;tests.py&lt;/strong&gt;&amp;nbsp;&amp;minus; This is where your unit tests are.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;views.py&lt;/strong&gt;&amp;nbsp;&amp;minus; This is where your application views are.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Get the Project to Know About Your Application&lt;/h2&gt;
&lt;p&gt;At this stage we have our &quot;myapp&quot; application, now we need to register it with our Django project &quot;myproject&quot;. To do so, update INSTALLED_APPS tuple in the settings.py file of your project (add your app name) &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;INSTALLED_APPS &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.contrib.admin&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.contrib.auth&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.contrib.contenttypes&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.contrib.sessions&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.contrib.messages&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.contrib.staticfiles&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;myapp&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;

&lt;h1&gt;Admin Interface&lt;/h1&gt;
&lt;p&gt;Django provides a ready-to-use user interface for administrative activities. We all know how an admin interface is important for a web project. Django automatically generates admin UI based on your project models.&lt;/p&gt;
&lt;h2&gt;Starting the Admin Interface&lt;/h2&gt;
&lt;p&gt;The Admin interface depends on the django.countrib module. To have it working you need to make sure some modules are imported in the INSTALLED_APPS and MIDDLEWARE_CLASSES tuples of the myproject/settings.py file.&lt;/p&gt;
&lt;p&gt;For INSTALLED_APPS make sure you have &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;INSTALLED_APPS &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.contrib.admin&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.contrib.auth&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.contrib.contenttypes&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.contrib.sessions&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.contrib.messages&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.contrib.staticfiles&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;myapp&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;For MIDDLEWARE_CLASSES &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;MIDDLEWARE_CLASSES &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.contrib.sessions.middleware.SessionMiddleware&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.middleware.common.CommonMiddleware&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.middleware.csrf.CsrfViewMiddleware&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.contrib.auth.middleware.AuthenticationMiddleware&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.contrib.messages.middleware.MessageMiddleware&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.middleware.clickjacking.XFrameOptionsMiddleware&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Before launching your server, to access your Admin Interface, you need to initiate the database &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;$ python manage.py migrate
&lt;/pre&gt;
&lt;p&gt;syncdb will create necessary tables or collections depending on your db type, necessary for the admin interface to run. Even if you don&#39;t have a superuser, you will be prompted to create one.&lt;/p&gt;
&lt;p&gt;If you already have a superuser or have forgotten it, you can always create one using the following code &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;$ python manage.py createsuperuser
&lt;/pre&gt;
&lt;p&gt;Now to start the Admin Interface, we need to make sure we have configured a URL for our admin interface. Open the myproject/url.py and you should have something like &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;conf&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;urls &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; include&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url

&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;contrib &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; admin
admin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;autodiscover&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

urlpatterns &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;com&quot;&gt;# Examples:&lt;/span&gt;
   &lt;span class=&quot;com&quot;&gt;# url(r&#39;^$&#39;, &#39;myproject.views.home&#39;, name = &#39;home&#39;),&lt;/span&gt;
   &lt;span class=&quot;com&quot;&gt;# url(r&#39;^blog/&#39;, include(&#39;blog.urls&#39;)),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^admin/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; include&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;admin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;site&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;urls&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)),&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Now just run the server.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;$ python manage.py runserver
&lt;/pre&gt;
&lt;p&gt;And your admin interface is accessible at: http://127.0.0.1:8000/admin/&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/admin_interface.jpg&quot; alt=&quot;Admin Interface&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Once connected with your superuser account, you will see the following screen &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/super_user_account.jpg&quot; alt=&quot;Super User Account&quot; /&gt;&lt;/p&gt;
&lt;p&gt;That interface will let you administrate Django groups and users, and all registered models in your app. The interface gives you the ability to do at least the &quot;CRUD&quot; (Create, Read, Update, Delete) operations on your models.&lt;/p&gt;

&lt;h1&gt;Creating Views&lt;/h1&gt;
&lt;p&gt;A view function, or &amp;ldquo;view&amp;rdquo; for short, is simply a Python function that takes a web request and returns a web response. This response can be the HTML contents of a Web page, or a redirect, or a 404 error, or an XML document, or an image, etc. Example: You use view to create web pages, note that you need to associate a view to a URL to see it as a web page.&lt;/p&gt;
&lt;p&gt;In Django, views have to be created in the app views.py file.&lt;/p&gt;
&lt;h2&gt;Simple View&lt;/h2&gt;
&lt;p&gt;We will create a simple view in myapp to say &quot;welcome to my app!&quot;&lt;/p&gt;
&lt;p&gt;See the following view &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;http &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; hello&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   text &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&quot;&quot;&amp;lt;h1&amp;gt;welcome to my app !&amp;lt;/h1&amp;gt;&quot;&quot;&quot;&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;In this view, we use HttpResponse to render the HTML (as you have probably noticed we have the HTML hard coded in the view). To see this view as a page we just need to map it to a URL (this will be discussed in an upcoming chapter).&lt;/p&gt;
&lt;p&gt;We used HttpResponse to render the HTML in the view before. This is not the best way to render pages. Django supports the MVT pattern so to make the precedent view, Django - MVT like, we will need &amp;minus;&lt;/p&gt;
&lt;p&gt;A template: myapp/templates/hello.html&lt;/p&gt;
&lt;p&gt;And now our view will look like &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;shortcuts &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; render

&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; hello&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; render&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;myapp/template/hello.html&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{})&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Views can also accept parameters &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;http &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; hello&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; number&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   text &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;h1&amp;gt;welcome to my app number %s!&amp;lt;/h1&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; number
   &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;When linked to a URL, the page will display the number passed as a parameter. Note that the parameters will be passed via the URL (discussed in the next chapter).&lt;/p&gt;

&lt;h1&gt;URL Mapping&lt;/h1&gt;
&lt;p&gt;Now that we have a working view as explained in the previous chapters. We want to access that view via a URL. Django has his own way for URL mapping and it&#39;s done by editing your project url.py file&amp;nbsp;&lt;strong&gt;(myproject/url.py)&lt;/strong&gt;. The url.py file looks like &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;conf&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;urls &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; include&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;contrib &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; admin
admin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;autodiscover&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

urlpatterns &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;com&quot;&gt;#Examples&lt;/span&gt;
   &lt;span class=&quot;com&quot;&gt;#url(r&#39;^$&#39;, &#39;myproject.view.home&#39;, name = &#39;home&#39;),&lt;/span&gt;
   &lt;span class=&quot;com&quot;&gt;#url(r&#39;^blog/&#39;, include(&#39;blog.urls&#39;)),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^admin&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; include&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;admin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;site&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;urls&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)),&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;When a user makes a request for a page on your web app, Django controller takes over to look for the corresponding view via the url.py file, and then return the HTML response or a 404 not found error, if not found. In url.py, the most important thing is the&amp;nbsp;&lt;strong&gt;&quot;urlpatterns&quot;&lt;/strong&gt;&amp;nbsp;tuple. It&amp;rsquo;s where you define the mapping between URLs and views. A mapping is a tuple in URL patterns like &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;conf&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;urls &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; include&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;contrib &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; admin
admin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;autodiscover&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

urlpatterns &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;com&quot;&gt;#Examples&lt;/span&gt;
   &lt;span class=&quot;com&quot;&gt;#url(r&#39;^$&#39;, &#39;myproject.view.home&#39;, name = &#39;home&#39;),&lt;/span&gt;
   &lt;span class=&quot;com&quot;&gt;#url(r&#39;^blog/&#39;, include(&#39;blog.urls&#39;)),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^admin&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; include&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;admin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;site&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;urls&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^hello/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;myapp.views.hello&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;hello&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The marked line maps the URL &quot;/home&quot; to the hello view created in myapp/view.py file. As you can see above a mapping is composed of three elements &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;The pattern&lt;/strong&gt;&amp;nbsp;&amp;minus; A regexp matching the URL you want to be resolved and map. Everything that can work with the python &#39;re&#39; module is eligible for the pattern (useful when you want to pass parameters via url).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;The python path to the view&lt;/strong&gt;&amp;nbsp;&amp;minus; Same as when you are importing a module.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;The name&lt;/strong&gt;&amp;nbsp;&amp;minus; In order to perform URL reversing, you&amp;rsquo;ll need to use named URL patterns as done in the examples above. Once done, just start the server to access your view via :http://127.0.0.1/hello&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Organizing Your URLs&lt;/h2&gt;
&lt;p&gt;So far, we have created the URLs in &amp;ldquo;myprojects/url.py&amp;rdquo; file, however as stated earlier about Django and creating an app, the best point was to be able to reuse applications in different projects. You can easily see what the problem is, if you are saving all your URLs in the &amp;ldquo;projecturl.py&amp;rdquo; file. So best practice is to create an &amp;ldquo;url.py&amp;rdquo; per application and to include it in our main projects url.py file (we included admin URLs for admin interface before).&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/organize_urls.jpg&quot; alt=&quot;Organize URLs&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;How is it Done?&lt;/h2&gt;
&lt;p&gt;We need to create an url.py file in myapp using the following code &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;conf&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;urls &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; include&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url

urlpatterns &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^hello/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;myapp.views.hello&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;hello&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Then myproject/url.py will change to the following &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;conf&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;urls &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; include&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;contrib &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; admin
admin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;autodiscover&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

urlpatterns &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;com&quot;&gt;#Examples&lt;/span&gt;
   &lt;span class=&quot;com&quot;&gt;#url(r&#39;^$&#39;, &#39;myproject.view.home&#39;, name = &#39;home&#39;),&lt;/span&gt;
   &lt;span class=&quot;com&quot;&gt;#url(r&#39;^blog/&#39;, include(&#39;blog.urls&#39;)),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^admin&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; include&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;admin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;site&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;urls&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^myapp/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; include&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;myapp.urls&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)),&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We have included all URLs from myapp application. The home.html that was accessed through &amp;ldquo;/hello&amp;rdquo; is now &amp;ldquo;/myapp/hello&amp;rdquo; which is a better and more understandable structure for the web app.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/myproject.jpg&quot; alt=&quot;Myproject&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now let&#39;s imagine we have another view in myapp &amp;ldquo;morning&amp;rdquo; and we want to map it in myapp/url.py, we will then change our myapp/url.py to &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;conf&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;urls &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; include&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url

urlpatterns &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^hello/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;myapp.views.hello&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;hello&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^morning/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;myapp.views.morning&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;morning&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This can be re-factored to &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;conf&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;urls &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; include&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url

urlpatterns &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;myapp.views&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^hello/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;hello&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;hello&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^morning/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;morning&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;morning&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;As you can see, we now use the first element of our&amp;nbsp;&lt;strong&gt;urlpatterns&lt;/strong&gt;&amp;nbsp;tuple. This can be useful when you want to change your app name.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/urlpatterns.jpg&quot; alt=&quot;URL Patterns&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Sending Parameters to Views&lt;/h2&gt;
&lt;p&gt;We now know how to map URL, how to organize them, now let us see how to send parameters to views. A classic sample is the article example (you want to access an article via &amp;ldquo;/articles/article_id&amp;rdquo;).&lt;/p&gt;
&lt;p&gt;Passing parameters is done by capturing them with the&amp;nbsp;&lt;strong&gt;regexp&lt;/strong&gt;&amp;nbsp;in the URL pattern. If we have a view like the following one in &amp;ldquo;myapp/view.py&amp;rdquo;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;shortcuts &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; render
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;http &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; hello&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; render&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;hello.html&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{})&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; viewArticle&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; articleId&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   text &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Displaying article Number : %s&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;articleId
   &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We want to map it in myapp/url.py so we can access it via &amp;ldquo;/myapp/article/articleId&amp;rdquo;, we need the following in &amp;ldquo;myapp/url.py&amp;rdquo; &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;conf&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;urls &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; include&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url

urlpatterns &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;myapp.views&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^hello/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;hello&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;hello&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^morning/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;morning&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;morning&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^article/(\d+)/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;viewArticle&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;article&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;When Django will see the url: &amp;ldquo;/myapp/article/42&amp;rdquo; it will pass the parameters &#39;42&#39; to the viewArticle view, and in your browser you should get the following result &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/passing_parameters_to_viewarticle.jpg&quot; alt=&quot;Passing parameters to viewArticle&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Note that the order of parameters is important here. Suppose we want the list of articles of a month of a year, let&#39;s add a viewArticles view. Our view.py becomes &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;shortcuts &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; render
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;http &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; hello&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; render&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;hello.html&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{})&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; viewArticle&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; articleId&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   text &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Displaying article Number : %s&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;articleId
   &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; viewArticle&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; month&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; year&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   text &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Displaying articles of : %s/%s&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;year&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; month&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The corresponding&amp;nbsp;&lt;strong&gt;url.py&lt;/strong&gt;&amp;nbsp;file will look like &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;conf&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;urls &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; include&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url

urlpatterns &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;myapp.views&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^hello/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;hello&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;hello&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^morning/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;morning&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;morning&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^article/(\d+)/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;viewArticle&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;article&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^articles/(\d{2})/(\d{4})&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;viewArticles&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;articles&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Now when you go to &amp;ldquo;/myapp/articles/12/2006/&amp;rdquo; you will get &#39;Displaying articles of: 2006/12&#39; but if you reverse the parameters you won&amp;rsquo;t get the same result.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/displaying_articles.jpg&quot; alt=&quot;Displaying Articles&quot; /&gt;&lt;/p&gt;
&lt;p&gt;To avoid that, it is possible to link a URL parameter to the view parameter. For that, our&amp;nbsp;&lt;strong&gt;url.py&lt;/strong&gt;&amp;nbsp;will become &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;conf&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;urls &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; include&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url

urlpatterns &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;myapp.views&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^hello/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;hello&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;hello&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^morning/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;morning&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;morning&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^article/(\d+)/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;viewArticle&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;article&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^articles/(?P\d{2})/(?P\d{4})&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;viewArticles&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;articles&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt;&lt;/pre&gt;

&lt;h1&gt;Template System&lt;/h1&gt;
&lt;p&gt;Django makes it possible to separate python and HTML, the python goes in views and HTML goes in templates. To link the two, Django relies on the render function and the Django Template language.&lt;/p&gt;
&lt;h2&gt;The Render Function&lt;/h2&gt;
&lt;p&gt;This function takes three parameters &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Request&lt;/strong&gt;&amp;nbsp;&amp;minus; The initial request.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;The path to the template&lt;/strong&gt;&amp;nbsp;&amp;minus; This is the path relative to the TEMPLATE_DIRS option in the project settings.py variables.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Dictionary of parameters&lt;/strong&gt;&amp;nbsp;&amp;minus; A dictionary that contains all variables needed in the template. This variable can be created or you can use locals() to pass all local variable declared in the view.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Django Template Language (DTL)&lt;/h2&gt;
&lt;p&gt;Django&amp;rsquo;s template engine offers a mini-language to define the user-facing layer of the application.&lt;/p&gt;
&lt;h3&gt;Displaying Variables&lt;/h3&gt;
&lt;p&gt;A variable looks like this: {{variable}}. The template replaces the variable by the variable sent by the view in the third parameter of the render function. Let&#39;s change our hello.html to display today&amp;rsquo;s date &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;hello.html&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      Hello World!!!&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Today is {{today}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
   
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Then our view will change to &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; hello&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   today &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; datetime&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;datetime&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;now&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;date&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; render&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;hello.html&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;today&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; today&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We will now get the following output after accessing the URL/myapp/hello &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;Hello World!!!
Today is Sept. 11, 2015
&lt;/pre&gt;
&lt;p&gt;As you have probably noticed, if the variable is not a string, Django will use the __str__ method to display it; and with the same principle you can access an object attribute just like you do it in Python. For example: if we wanted to display the date year, my variable would be: {{today.year}}.&lt;/p&gt;
&lt;h2&gt;Filters&lt;/h2&gt;
&lt;p&gt;They help you modify variables at display time. Filters structure looks like the following: {{var|filters}}.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Some examples&lt;/strong&gt;&amp;nbsp;&amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;{{string|truncatewords:80}}&lt;/strong&gt;&amp;nbsp;&amp;minus; This filter will truncate the string, so you will see only the first 80 words.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;{{string|lower}}&lt;/strong&gt;&amp;nbsp;&amp;minus; Converts the string to lowercase.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;{{string|escape|linebreaks}}&lt;/strong&gt;&amp;nbsp;&amp;minus; Escapes string contents, then converts line breaks to tags.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can also set the default for a variable.&lt;/p&gt;
&lt;h2&gt;Tags&lt;/h2&gt;
&lt;p&gt;Tags lets you perform the following operations: if condition, for loop, template inheritance and more.&lt;/p&gt;
&lt;h3&gt;Tag if&lt;/h3&gt;
&lt;p&gt;Just like in Python you can use if, else and elif in your template &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   
      Hello World!!!&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Today is {{today}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      We are
      {% if today.day == 1 %}
      
      the first day of month.
      {% elif today.day == 30 %}
      
      the last day of month.
      {% else %}
      
      I don&#39;t know.
      {%endif%}
      
   &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;In this new template, depending on the date of the day, the template will render a certain value.&lt;/p&gt;
&lt;h3&gt;Tag for&lt;/h3&gt;
&lt;p&gt;Just like &#39;if&#39;, we have the &#39;for&#39; tag, that works exactly like in Python. Let&#39;s change our hello view to transmit a list to our template &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; hello&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   today &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; datetime&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;datetime&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;now&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;date&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   
   daysOfWeek &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Mon&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Tue&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Wed&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Thu&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Fri&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Sat&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Sun&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; render&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;hello.html&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;today&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; today&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;days_of_week&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; daysOfWeek&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The template to display that list using {{ for }} &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      
      Hello World!!!&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Today is {{today}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      We are
      {% if today.day == 1 %}
      
      the first day of month.
      {% elif today.day == 30 %}
      
      the last day of month.
      {% else %}
      
      I don&#39;t know.
      {%endif%}
      
      &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         {% for day in days_of_week %}
         {{day}}
      &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
		
      {% endfor %}
      
   &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;And we should get something like &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;Hello World!!!
Today is Sept. 11, 2015
We are I don&#39;t know.
Mon
Tue
Wed
Thu
Fri
Sat
Sun
&lt;/pre&gt;
&lt;h3&gt;Block and Extend Tags&lt;/h3&gt;
&lt;p&gt;A template system cannot be complete without template inheritance. Meaning when you are designing your templates, you should have a main template with holes that the child&#39;s template will fill according to his own need, like a page might need a special css for the selected tab.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s change the hello.html template to inherit from a main_template.html.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;main_template.html&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         {% block title %}Page Title{% endblock %}
      &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
	
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   
      {% block content %}
         Body content
      {% endblock %}
      
   &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;hello.html&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;main_template.html&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; block title &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;My&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Hello&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Page&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; endblock &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; block content &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;

&lt;span class=&quot;typ&quot;&gt;Hello&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;World&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;!!!&amp;lt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Today&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;today&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}}&amp;lt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;typ&quot;&gt;We&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; are
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; today&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;day &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

the first day of month&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;elif&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; today&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;day &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;30&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

the &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;last&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; day of month&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

I don&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;t know.
{%endif%}

&amp;lt;p&amp;gt;
   {% for day in days_of_week %}
   {{day}}
&amp;lt;/p&amp;gt;

{% endfor %}
{% endblock %}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;In the above example, on calling /myapp/hello we will still get the same result as before but now we rely on extends and block to refactor our code &amp;minus;&lt;/p&gt;
&lt;p&gt;In the main_template.html we define blocks using the tag block. The title block will contain the page title and the content block will have the page main content. In home.html we use extends to inherit from the main_template.html then we fill the block define above (content and title).&lt;/p&gt;
&lt;h3&gt;Comment Tag&lt;/h3&gt;
&lt;p&gt;The comment tag helps to define comments into templates, not HTML comments, they won&amp;rsquo;t appear in HTML page. It can be useful for documentation or just commenting a line of code.&lt;/p&gt;

&lt;h1&gt;Models&lt;/h1&gt;
&lt;p&gt;A model is a class that represents table or collection in our DB, and where every attribute of the class is a field of the table or collection. Models are defined in the app/models.py (in our example: myapp/models.py)&lt;/p&gt;
&lt;h2&gt;Creating a Model&lt;/h2&gt;
&lt;p&gt;Following is a Dreamreal model created as an example &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;db &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; models

&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Dreamreal&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;models&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Model&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

   website &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; models&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;CharField&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;max_length &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   mail &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; models&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;CharField&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;max_length &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; models&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;CharField&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;max_length &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   phonenumber &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; models&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;IntegerField&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;

   &lt;span class=&quot;kwd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Meta&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      db_table &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;dreamreal&quot;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Every model inherits from django.db.models.Model.&lt;/p&gt;
&lt;p&gt;Our class has 4 attributes (3 CharField and 1 Integer), those will be the table fields.&lt;/p&gt;
&lt;p&gt;The Meta class with the db_table attribute lets us define the actual table or collection name. Django names the table or collection automatically: myapp_modelName. This class will let you force the name of the table to what you like.&lt;/p&gt;
&lt;p&gt;There is more field&#39;s type in django.db.models, you can learn more about them on&amp;nbsp;&lt;a href=&quot;https://docs.djangoproject.com/en/1.5/ref/models/fields/#field-types&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://docs.djangoproject.com/en/1.5/ref/models/fields/#field-types&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;After creating your model, you will need Django to generate the actual database &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;$python manage.py syncdb
&lt;/pre&gt;
&lt;h3&gt;Manipulating Data (CRUD)&lt;/h3&gt;
&lt;p&gt;Let&#39;s create a &quot;crudops&quot; view to see how we can do CRUD operations on models. Our myapp/views.py will then look like &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;myapp/views.py&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myapp&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;models &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Dreamreal&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;http &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; crudops&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;
   &lt;span class=&quot;com&quot;&gt;#Creating an entry&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   
   dreamreal &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Dreamreal&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      website &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;www.polo.com&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mail &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;sorex@polo.com&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
      name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;sorex&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; phonenumber &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;002376970&quot;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   
   dreamreal&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;save&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;
   
   &lt;span class=&quot;com&quot;&gt;#Read ALL entries&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   objects &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Dreamreal&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;objects&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;all&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   res &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Printing all Dreamreal entries in the DB : &amp;lt;br&amp;gt;&#39;&lt;/span&gt;
   
   &lt;span class=&quot;kwd&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; elt &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; objects&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      res &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; elt&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;br&amp;gt;&quot;&lt;/span&gt;
   
   &lt;span class=&quot;com&quot;&gt;#Read a specific entry:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   sorex &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Dreamreal&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;objects&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;sorex&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   res &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Printing One entry &amp;lt;br&amp;gt;&#39;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   res &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; sorex&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name
   
   &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;#Delete an entry&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   res &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;br&amp;gt; Deleting an entry &amp;lt;br&amp;gt;&#39;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   sorex&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;delete&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;
   
   &lt;span class=&quot;com&quot;&gt;#Update&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   dreamreal &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Dreamreal&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      website &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;www.polo.com&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mail &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;sorex@polo.com&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
      name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;sorex&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; phonenumber &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;002376970&quot;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   
   dreamreal&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;save&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   res &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Updating entry&amp;lt;br&amp;gt;&#39;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   
   dreamreal &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Dreamreal&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;objects&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;sorex&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   dreamreal&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;thierry&#39;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   dreamreal&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;save&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;
   
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Other Data Manipulation&lt;/h3&gt;
&lt;p&gt;Let&#39;s explore other manipulations we can do on Models. Note that the CRUD operations were done on instances of our model, now we will be working directly with the class representing our model.&lt;/p&gt;
&lt;p&gt;Let&#39;s create a &#39;datamanipulation&#39; view in&amp;nbsp;&lt;strong&gt;myapp/views.py&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myapp&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;models &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Dreamreal&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;http &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; datamanipulation&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   res &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt;
   
   &lt;span class=&quot;com&quot;&gt;#Filtering data:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   qs &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Dreamreal&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;objects&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;paul&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   res &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Found : %s results&amp;lt;br&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;len&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;qs&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
   
   &lt;span class=&quot;com&quot;&gt;#Ordering results&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   qs &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Dreamreal&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;objects&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;order_by&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
   
   &lt;span class=&quot;kwd&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; elt &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; qs&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      res &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; elt&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;br&amp;gt;&#39;&lt;/span&gt;
   
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;Linking Models&lt;/h2&gt;
&lt;p&gt;Django ORM offers 3 ways to link models &amp;minus;&lt;/p&gt;
&lt;p&gt;One of the first case we will see here is the one-to-many relationships. As you can see in the above example, Dreamreal company can have multiple online websites. Defining that relation is done by using django.db.models.ForeignKey &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;myapp/models.py&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;db &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; models

&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Dreamreal&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;models&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Model&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   website &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; models&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;CharField&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;max_length &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   mail &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; models&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;CharField&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;max_length &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; models&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;CharField&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;max_length &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   phonenumber &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; models&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;IntegerField&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   online &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; models&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;ForeignKey&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Online&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;default&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
   
   &lt;span class=&quot;kwd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Meta&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      db_table &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;dreamreal&quot;&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Online&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;models&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Model&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      domain &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; models&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;CharField&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;max_length &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;30&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
   
   &lt;span class=&quot;kwd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Meta&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      db_table &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;online&quot;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;As you can see in our updated myapp/models.py, we added the online model and linked it to our Dreamreal model.&lt;/p&gt;
&lt;p&gt;Let&#39;s check how all of this is working via manage.py shell &amp;minus;&lt;/p&gt;
&lt;p&gt;First let&amp;rsquo;s create some companies (Dreamreal entries) for testing in our Django shell &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;$python manage&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;py shell

&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myapp&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;models &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Dreamreal&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Online&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dr1 &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Dreamreal&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dr1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;website &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;company1.com&#39;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dr1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;company1&#39;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dr1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;mail &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;contact@company1&#39;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dr1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;phonenumber &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;12345&#39;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dr1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;save&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dr2 &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Dreamreal&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dr1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;website &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;company2.com&#39;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dr2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;website &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;company2.com&#39;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dr2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;company2&#39;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dr2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;mail &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;contact@company2&#39;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dr2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;phonenumber &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;56789&#39;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dr2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;save&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Now some hosted domains &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; on1 &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Online&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; on1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;company &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dr1
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; on1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;domain &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;site1.com&quot;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; on2 &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Online&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; on2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;company &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dr1
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; on2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;domain &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;site2.com&quot;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; on3 &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Online&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; on3&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;domain &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;site3.com&quot;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dr2 &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Dreamreal&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;objects&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;all&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; on3&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;company &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dr2
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; on1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;save&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; on2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;save&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; on3&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;save&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Accessing attribute of the hosting company (Dreamreal entry) from an online domain is simple &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&amp;gt;&amp;gt;&amp;gt; on1.company.name
&lt;/pre&gt;
&lt;p&gt;And if we want to know all the online domain hosted by a Company in Dreamreal we will use the code &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&amp;gt;&amp;gt;&amp;gt; dr1.online_set.all()
&lt;/pre&gt;
&lt;p&gt;To get a QuerySet, note that all manipulating method we have seen before (filter, all, exclude, order_by....)&lt;/p&gt;
&lt;p&gt;You can also access the linked model attributes for filtering operations, let&#39;s say you want to get all online domains where the Dreamreal name contains &#39;company&#39; &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&amp;gt;&amp;gt;&amp;gt; Online.objects.filter(company__name__contains = &#39;company&#39;
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&amp;nbsp;&amp;minus; That kind of query is just supported for SQL DB. It won&amp;rsquo;t work for non-relational DB where joins doesn&amp;rsquo;t exist and there are two &#39;_&#39;.&lt;/p&gt;
&lt;p&gt;But that&#39;s not the only way to link models, you also have OneToOneField, a link that guarantees that the relation between two objects is unique. If we used the OneToOneField in our example above, that would mean for every Dreamreal entry only one Online entry is possible and in the other way to.&lt;/p&gt;
&lt;p&gt;And the last one, the ManyToManyField for (n-n) relation between tables. Note, those are relevant for SQL based DB.&lt;/p&gt;

&lt;h1&gt;Page Redirection&lt;/h1&gt;
&lt;p&gt;Page redirection is needed for many reasons in web application. You might want to redirect a user to another page when a specific action occurs, or basically in case of error. For example, when a user logs in to your website, he is often redirected either to the main home page or to his personal dashboard. In Django, redirection is accomplished using the &#39;redirect&#39; method.&lt;/p&gt;
&lt;p&gt;The &#39;redirect&#39; method takes as argument: The URL you want to be redirected to as string A view&#39;s name.&lt;/p&gt;
&lt;p&gt;The myapp/views looks like the following so far &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; hello&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   today &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; datetime&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;datetime&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;now&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;date&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   daysOfWeek &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Mon&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Tue&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Wed&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Thu&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Fri&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Sat&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Sun&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; render&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;hello.html&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;today&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; today&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;days_of_week&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; daysOfWeek&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;
	
&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; viewArticle&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; articleId&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&quot;&quot;&quot; A view that display an article based on his ID&quot;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   text &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Displaying article Number : %s&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;articleId
   &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
	
&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; viewArticles&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; year&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; month&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   text &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Displaying articles of : %s/%s&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;year&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; month&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Let&#39;s change the hello view to redirect to djangoproject.com and our viewArticle to redirect to our internal &#39;/myapp/articles&#39;. To do so the myapp/view.py will change to &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;shortcuts &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; render&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; redirect
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;http &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; datetime

&lt;/span&gt;&lt;span class=&quot;com&quot;&gt;# Create your views here.&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; hello&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   today &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; datetime&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;datetime&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;now&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;date&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   daysOfWeek &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Mon&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Tue&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Wed&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Thu&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Fri&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Sat&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Sun&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; redirect&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;https://www.djangoproject.com&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
	
&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; viewArticle&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; articleId&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&quot;&quot;&quot; A view that display an article based on his ID&quot;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   text &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Displaying article Number : %s&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;articleId
   &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; redirect&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;viewArticles&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; year &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;2045&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; month &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;02&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
	
&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; viewArticles&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; year&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; month&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   text &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Displaying articles of : %s/%s&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;year&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; month&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;In the above example, first we imported redirect from django.shortcuts and for redirection to the Django official website we just pass the full URL to the &#39;redirect&#39; method as string, and for the second example (the viewArticle view) the &#39;redirect&#39; method takes the view name and his parameters as arguments.&lt;/p&gt;
&lt;p&gt;Accessing /myapp/hello, will give you the following screen &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/django_page_redirection_example1.jpg&quot; alt=&quot;Django page Redirection Example1&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And accessing /myapp/article/42, will give you the following screen &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/django_page_redirection_example2.jpg&quot; alt=&quot;Django page Redirection Example2&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It is also possible to specify whether the &#39;redirect&#39; is temporary or permanent by adding permanent = True parameter. The user will see no difference, but these are details that search engines take into account when ranking of your website.&lt;/p&gt;
&lt;p&gt;Also remember that &#39;name&#39; parameter we defined in our url.py while mapping the URLs &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;url(r&#39;^articles/(?P\d{2})/(?P\d{4})/&#39;, &#39;viewArticles&#39;, name = &#39;articles&#39;),
&lt;/pre&gt;
&lt;p&gt;That name (here article) can be used as argument for the &#39;redirect&#39; method, then our viewArticle redirection can be changed from &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; viewArticle&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; articleId&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&quot;&quot;&quot; A view that display an article based on his ID&quot;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   text &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Displaying article Number : %s&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;articleId
   &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; redirect&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;viewArticles&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; year &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;2045&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; month &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;02&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;To&lt;/strong&gt;&amp;nbsp;&amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; viewArticle&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; articleId&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&quot;&quot;&quot; A view that display an article based on his ID&quot;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   text &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Displaying article Number : %s&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;articleId
   &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; redirect&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;articles&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; year &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;2045&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; month &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;02&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&amp;nbsp;&amp;minus; There is also a function to generate URLs; it is used in the same way as redirect; the &#39;reverse&#39; method (django.core.urlresolvers.reverse). This function does not return a HttpResponseRedirect object, but simply a string containing the URL to the view compiled with any passed argument.&lt;/p&gt;

&lt;h1&gt;Sending E-mail&lt;/h1&gt;
&lt;p&gt;Django comes with a ready and easy-to-use light engine to send e-mail. Similar to Python you just need an import of smtplib. In Django you just need to import django.core.mail. To start sending e-mail, edit your project settings.py file and set the following options &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;EMAIL_HOST&lt;/strong&gt;&amp;nbsp;&amp;minus; smtp server.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;EMAIL_HOST_USER&lt;/strong&gt;&amp;nbsp;&amp;minus; Login credential for the smtp server.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;EMAIL_HOST_PASSWORD&lt;/strong&gt;&amp;nbsp;&amp;minus; Password credential for the smtp server.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;EMAIL_PORT&lt;/strong&gt;&amp;nbsp;&amp;minus; smtp server port.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;EMAIL_USE_TLS or _SSL&lt;/strong&gt;&amp;nbsp;&amp;minus; True if secure connection.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Sending a Simple E-mail&lt;/h2&gt;
&lt;p&gt;Let&#39;s create a &quot;sendSimpleEmail&quot; view to send a simple e-mail.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;core&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;mail &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; send_mail
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;http &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; sendSimpleEmail&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;emailto&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   res &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; send_mail&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;hello paul&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;comment tu vas?&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;paul@polo.com&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;emailto&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;])&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;%s&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Here is the details of the parameters of send_mail &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;subject&lt;/strong&gt;&amp;nbsp;&amp;minus; E-mail subject.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;message&lt;/strong&gt;&amp;nbsp;&amp;minus; E-mail body.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;from_email&lt;/strong&gt;&amp;nbsp;&amp;minus; E-mail from.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;recipient_list&lt;/strong&gt;&amp;nbsp;&amp;minus; List of receivers&amp;rsquo; e-mail address.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;fail_silently&lt;/strong&gt;&amp;nbsp;&amp;minus; Bool, if false send_mail will raise an exception in case of error.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;auth_user&lt;/strong&gt;&amp;nbsp;&amp;minus; User login if not set in settings.py.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;auth_password&lt;/strong&gt;&amp;nbsp;&amp;minus; User password if not set in settings.py.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;connection&lt;/strong&gt;&amp;nbsp;&amp;minus; E-mail backend.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;html_message&lt;/strong&gt;&amp;nbsp;&amp;minus; (new in Django 1.7) if present, the e-mail will be multipart/alternative.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let&#39;s create a URL to access our view &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;conf&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;urls &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url

urlpatterns &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; paterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;myapp.views&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^simpleemail/(?P&amp;lt;emailto&amp;gt;
   [\w.%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4})/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; 
   &lt;span class=&quot;str&quot;&gt;&#39;sendSimpleEmail&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;sendSimpleEmail&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;So when accessing /myapp/simpleemail/polo@gmail.com, you will get the following page &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/sending_simple_email.jpg&quot; alt=&quot;Sending Simple E-mail&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Sending Multiple Mails with send_mass_mail&lt;/h2&gt;
&lt;p&gt;The method returns the number of messages successfully delivered. This is same as send_mail but takes an extra parameter; datatuple, our sendMassEmail view will then be &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;core&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;mail &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; send_mass_mail
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;http &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; sendMassEmail&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;emailto&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   msg1 &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;subject 1&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;message 1&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;polo@polo.com&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;emailto1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;])&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   msg2 &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;subject 2&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;message 2&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;polo@polo.com&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;emailto2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;])&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   res &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; send_mass_mail&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;msg1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; msg2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; fail_silently &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;%&lt;/span&gt;&lt;strong&gt;&lt;span class=&quot;str&quot;&gt;s&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;str&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Let&#39;s create a URL to access our view &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;conf&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;urls &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url

urlpatterns &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; paterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;myapp.views&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^massEmail/(?P&amp;lt;emailto1&amp;gt;
   [\w.%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4})/(?P&amp;lt;emailto2&amp;gt;
   [\w.%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4})&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;sendMassEmail&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;sendMassEmail&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;When accessing /myapp/massemail/polo@gmail.com/sorex@gmail.com/, we get &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/sending_multiple_mails.jpg&quot; alt=&quot;Sending Multiple Mails&quot; /&gt;&lt;/p&gt;
&lt;p&gt;send_mass_mail parameters details are &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;datatuples&lt;/strong&gt;&amp;nbsp;&amp;minus; A tuple where each element is like (subject, message, from_email, recipient_list).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;fail_silently&lt;/strong&gt;&amp;nbsp;&amp;minus; Bool, if false send_mail will raise an exception in case of error.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;auth_user&lt;/strong&gt;&amp;nbsp;&amp;minus; User login if not set in settings.py.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;auth_password&lt;/strong&gt;&amp;nbsp;&amp;minus; User password if not set in settings.py.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;connection&lt;/strong&gt;&amp;nbsp;&amp;minus; E-mail backend.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As you can see in the above image, two messages were sent successfully.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&amp;nbsp;&amp;minus; In this example we are using Python smtp debuggingserver, that you can launch using &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;$python -m smtpd -n -c DebuggingServer localhost:1025
&lt;/pre&gt;
&lt;p&gt;This means all your sent e-mails will be printed on stdout, and the dummy server is running on localhost:1025.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Sending e-mails to admins and managers using mail_admins and mail_managers methods&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;These methods send e-mails to site administrators as defined in the ADMINS option of the settings.py file, and to site managers as defined in MANAGERS option of the settings.py file. Let&#39;s assume our ADMINS and MANAGERS options look like &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ADMINS&lt;/strong&gt;&amp;nbsp;= ((&#39;polo&#39;, &#39;polo@polo.com&#39;),)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;MANAGERS&lt;/strong&gt;&amp;nbsp;= ((&#39;popoli&#39;, &#39;popoli@polo.com&#39;),)&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;core&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;mail &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mail_admins
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;http &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; sendAdminsEmail&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   res &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mail_admins&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;my subject&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;site is going down.&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;&lt;/span&gt;&lt;strong&gt;&lt;span class=&quot;str&quot;&gt;%s&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;str&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The above code will send an e-mail to every admin defined in the ADMINS section.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;core&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;mail &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mail_managers
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;http &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; sendManagersEmail&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   res &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mail_managers&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;my subject 2&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Change date on the site.&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;&lt;/span&gt;&lt;strong&gt;&lt;span class=&quot;str&quot;&gt;%s&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;str&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The above code will send an e-mail to every manager defined in the MANAGERS section.&lt;/p&gt;
&lt;p&gt;Parameters details &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subject&lt;/strong&gt;&amp;nbsp;&amp;minus; E-mail subject.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;message&lt;/strong&gt;&amp;nbsp;&amp;minus; E-mail body.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;fail_silently&lt;/strong&gt;&amp;nbsp;&amp;minus; Bool, if false send_mail will raise an exception in case of error.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;connection&lt;/strong&gt;&amp;nbsp;&amp;minus; E-mail backend.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;html_message&lt;/strong&gt;&amp;nbsp;&amp;minus; (new in Django 1.7) if present, the e-mail will be multipart/alternative.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Sending HTML E-mail&lt;/h2&gt;
&lt;p&gt;Sending HTML message in Django &amp;gt;= 1.7 is as easy as &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;core&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;mail &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; send_mail

&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;http &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   res &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; send_mail&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;hello paul&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;comment tu vas?&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;paul@polo.com&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; 
         &lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;polo@gmail.com&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; html_message&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This will produce a multipart/alternative e-mail.&lt;/p&gt;
&lt;p&gt;But for Django &amp;lt; 1.7 sending HTML messages is done via the django.core.mail.EmailMessage class then calling &#39;send&#39; on the object &amp;minus;&lt;/p&gt;
&lt;p&gt;Let&#39;s create a &quot;sendHTMLEmail&quot; view to send an HTML e-mail.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;core&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;mail &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;EmailMessage&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;http &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; sendHTMLEmail&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; emailto&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   html_content &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;strong&amp;gt;Comment tu vas?&amp;lt;/strong&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   email &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;EmailMessage&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;my subject&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; html_content&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;paul@polo.com&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;emailto&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;])&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   email&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;content_subtype &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;html&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   res &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; email&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;send&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;&lt;/span&gt;&lt;strong&gt;&lt;span class=&quot;str&quot;&gt;%s&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;str&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Parameters details for the EmailMessage class creation &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subject&lt;/strong&gt;&amp;nbsp;&amp;minus; E-mail subject.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;message&lt;/strong&gt;&amp;nbsp;&amp;minus; E-mail body in HTML.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;from_email&lt;/strong&gt;&amp;nbsp;&amp;minus; E-mail from.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;to&lt;/strong&gt;&amp;nbsp;&amp;minus; List of receivers&amp;rsquo; e-mail address.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;bcc&lt;/strong&gt;&amp;nbsp;&amp;minus; List of &amp;ldquo;Bcc&amp;rdquo; receivers&amp;rsquo; e-mail address.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;connection&lt;/strong&gt;&amp;nbsp;&amp;minus; E-mail backend.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let&#39;s create a URL to access our view &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;conf&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;urls &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url

urlpatterns &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; paterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;myapp.views&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^htmlemail/(?P&amp;lt;emailto&amp;gt;
   [\w.%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4})/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; 
   &lt;span class=&quot;str&quot;&gt;&#39;sendHTMLEmail&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;sendHTMLEmail&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;When accessing /myapp/htmlemail/polo@gmail.com, we get &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/sending_html_email.jpg&quot; alt=&quot;Sending HTML E-mail&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Sending E-mail with Attachment&lt;/h2&gt;
&lt;p&gt;This is done by using the &#39;attach&#39; method on the EmailMessage object.&lt;/p&gt;
&lt;p&gt;A view to send an e-mail with attachment will be &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;core&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;mail &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;EmailMessage&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;http &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; sendEmailWithAttach&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; emailto&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   html_content &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;&lt;/span&gt;&lt;strong&gt;&lt;span class=&quot;str&quot;&gt;Comment tu vas?&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;str&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   email &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;EmailMessage&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;my subject&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; html_content&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;paul@polo.com&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; emailto&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;])&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   email&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;content_subtype &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;html&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   
   fd &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; open&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;manage.py&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;r&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   email&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;attach&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;manage.py&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; fd&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;read&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(),&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;text/plain&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   
   res &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; email&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;send&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;&lt;/span&gt;&lt;strong&gt;&lt;span class=&quot;str&quot;&gt;%s&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;str&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Details on attach arguments &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;filename&lt;/strong&gt;&amp;nbsp;&amp;minus; The name of the file to attach.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;content&lt;/strong&gt;&amp;nbsp;&amp;minus; The content of the file to attach.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;mimetype&lt;/strong&gt;&amp;nbsp;&amp;minus; The attachment&#39;s content mime type.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
attach.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;content&lt;/strong&gt;&amp;nbsp;&amp;minus; The content of the file to attach.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;mimetype&lt;/strong&gt;&amp;nbsp;&amp;minus; The attachment&#39;s content mime type.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;Generic Views&lt;/h1&gt;
&lt;p&gt;In some cases, writing views, as we have seen earlier is really heavy. Imagine you need a static page or a listing page. Django offers an easy way to set those simple views that is called generic views.&lt;/p&gt;
&lt;p&gt;Unlike classic views, generic views are classes not functions. Django offers a set of classes for generic views in django.views.generic, and every generic view is one of those classes or a class that inherits from one of them.&lt;/p&gt;
&lt;p&gt;There are 10+ generic classes &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;views&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;generic&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dir&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;views&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;generic&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;ArchiveIndexView&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;CreateView&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;DateDetailView&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;DayArchiveView&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; 
   &lt;span class=&quot;str&quot;&gt;&#39;DeleteView&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;DetailView&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;FormView&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;GenericViewError&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;ListView&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; 
   &lt;span class=&quot;str&quot;&gt;&#39;MonthArchiveView&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;RedirectView&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;TemplateView&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;TodayArchiveView&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; 
   &lt;span class=&quot;str&quot;&gt;&#39;UpdateView&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;View&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;WeekArchiveView&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;YearArchiveView&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;__builtins__&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; 
   &lt;span class=&quot;str&quot;&gt;&#39;__doc__&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;__file__&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;__name__&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;__package__&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;__path__&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;base&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;dates&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; 
   &lt;span class=&quot;str&quot;&gt;&#39;detail&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;edit&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;list&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This you can use for your generic view. Let&#39;s look at some example to see how it works.&lt;/p&gt;
&lt;h2&gt;Static Pages&lt;/h2&gt;
&lt;p&gt;Let&#39;s publish a static page from the &amp;ldquo;static.html&amp;rdquo; template.&lt;/p&gt;
&lt;p&gt;Our static.html &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
      This is a static page!!! 
   &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;If we did that the way we learned before, we would have to change the&amp;nbsp;&lt;strong&gt;myapp/views.py&lt;/strong&gt;to be &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;shortcuts &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; render

&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; render&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;static.html&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{})&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;and&amp;nbsp;&lt;strong&gt;myapp/urls.py&lt;/strong&gt;&amp;nbsp;to be &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;conf&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;urls &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url

urlpatterns &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;myapp.views&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^static/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;static&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;static&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The best way is to use generic views. For that, our myapp/views.py will become &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;views&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;generic&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;TemplateView&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;StaticView&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;TemplateView&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   template_name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;static.html&quot;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;And our myapp/urls.py we will be &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myapp&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;views &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;StaticView&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;conf&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;urls &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns

urlpatterns &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;myapp.views&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^static/$&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;StaticView&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;as_view&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()),)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;When accessing /myapp/static you get &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/static_page.jpg&quot; alt=&quot;Static Page&quot; /&gt;&lt;/p&gt;
&lt;p&gt;For the same result we can also, do the following &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;No change in the views.py&lt;/li&gt;
&lt;li&gt;Change the url.py file to be &amp;minus;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;views&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;generic&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;TemplateView&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;conf&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;urls &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url

urlpatterns &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;myapp.views&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^static/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;TemplateView&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;as_view&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;template_name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;static.html&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)),)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;As you can see, you just need to change the url.py file in the second method.&lt;/p&gt;
&lt;h3&gt;List and Display Data from DB&lt;/h3&gt;
&lt;p&gt;We are going to list all entries in our Dreamreal model. Doing so is made easy by using the ListView generic view class. Edit the url.py file and update it as &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;views&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;generic&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;ListView&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;conf&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;urls &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url

urlpatterns &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&quot;myapp.views&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^dreamreals/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;ListView&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;as_view&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;model &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Dreamreal&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
      template_name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;dreamreal_list.html&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)),&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Important to note at this point is that the variable pass by the generic view to the template is object_list. If you want to name it yourself, you will need to add a context_object_name argument to the as_view method. Then the url.py will become &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;views&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;generic&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;ListView&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;conf&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;urls &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url

urlpatterns &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;myapp.views&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^dreamreals/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;ListView&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;as_view&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      template_name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;dreamreal_list.html&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      model &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Dreamreal&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; context_object_name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;&amp;rdquo;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;dreamreals_objects&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;rdquo;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;,)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The associated template will then be &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;main_template.html&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; block content &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;
&lt;span class=&quot;typ&quot;&gt;Dreamreals&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&amp;lt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dr &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; object_list &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;{{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;dr&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}}&amp;lt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; endfor &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; endblock &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Accessing /myapp/dreamreals/ will produce the following page &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/list_display_data_from_db.jpg&quot; alt=&quot;List and Display Data from DB&quot; /&gt;&lt;/p&gt;

&lt;h1&gt;Form Processing&lt;/h1&gt;
&lt;p&gt;Creating forms in Django, is really similar to creating a model. Here again, we just need to inherit from Django class and the class attributes will be the form fields. Let&#39;s add a&amp;nbsp;&lt;strong&gt;forms.py&lt;/strong&gt;&amp;nbsp;file in myapp folder to contain our app forms. We will create a login form.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;myapp/forms.py&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;com&quot;&gt;#-*- coding: utf-8 -*-&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; forms

&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;LoginForm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;forms&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Form&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   user &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; forms&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;CharField&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;max_length &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   password &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; forms&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;CharField&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;widget &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; forms&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;PasswordInput&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;())&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;As seen above, the field type can take &quot;widget&quot; argument for html rendering; in our case, we want the password to be hidden, not displayed. Many others widget are present in Django:&amp;nbsp;&lt;strong&gt;DateInput&lt;/strong&gt;&amp;nbsp;for dates,&amp;nbsp;&lt;strong&gt;CheckboxInput&lt;/strong&gt;&amp;nbsp;for checkboxes, etc.&lt;/p&gt;
&lt;h2&gt;Using Form in a View&lt;/h2&gt;
&lt;p&gt;There are two kinds of HTTP requests, GET and POST. In Django, the request object passed as parameter to your view has an attribute called &quot;method&quot; where the type of the request is set, and all data passed via POST can be accessed via the request.POST dictionary.&lt;/p&gt;
&lt;p&gt;Let&#39;s create a login view in our myapp/views.py &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;com&quot;&gt;#-*- coding: utf-8 -*-&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myapp&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;forms &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;LoginForm&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; login&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   username &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;not logged in&quot;&lt;/span&gt;
   
   &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;method &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;POST&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;com&quot;&gt;#Get the posted form&lt;/span&gt;
      &lt;span class=&quot;typ&quot;&gt;MyLoginForm&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;LoginForm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;POST&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
      
      &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;MyLoginForm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;is_valid&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;():&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         username &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;MyLoginForm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;cleaned_data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;username&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;typ&quot;&gt;MyLoginForm&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Loginform&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;
		
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; render&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;loggedin.html&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;username&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; username&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The view will display the result of the login form posted through the&amp;nbsp;&lt;strong&gt;loggedin.html&lt;/strong&gt;. To test it, we will first need the login form template. Let&#39;s call it login.html.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;form&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;form&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;action&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;{% url &quot;&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;myapp&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;views&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;login&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot; %}&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;method&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;POST&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{% csrf_token %}
         
         &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;max&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;470px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;center&amp;gt;&lt;/span&gt; 
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; 
                  &lt;span class=&quot;atn&quot;&gt;placeholder&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Identifiant&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;username&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/center&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
			
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;br&amp;gt;&lt;/span&gt;
         
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;max&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;470px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;center&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;password&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; 
                  &lt;span class=&quot;atn&quot;&gt;placeholder&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;password&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;password&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/center&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
			
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;br&amp;gt;&lt;/span&gt;
         
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;max&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;470px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;center&amp;gt;&lt;/span&gt; 
            
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:#&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;4285F4&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; margin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
                  height&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;35px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;80&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;19&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;submit&quot;&lt;/span&gt; 
                  &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Login&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
                  &lt;span class=&quot;tag&quot;&gt;&amp;lt;strong&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Login&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/strong&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
               
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/center&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
         
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;
      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The template will display a login form and post the result to our login view above. You have probably noticed the tag in the template, which is just to prevent Cross-site Request Forgery (CSRF) attack on your site.&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;{% csrf_token %}
&lt;/pre&gt;
&lt;p&gt;Once we have the login template, we need the loggedin.html template that will be rendered after form treatment.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      You are : &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;strong&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{{username}}&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/strong&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
   
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Now, we just need our pair of URLs to get started: myapp/urls.py&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;conf&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;urls &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;views&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;generic&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;TemplateView&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

urlpatterns &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;myapp.views&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^connection/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;TemplateView&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;as_view&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;template_name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;login.html&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^login/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;login&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;login&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;))&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;When accessing &quot;/myapp/connection&quot;, we will get the following login.html template rendered &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/login_html_template.jpg&quot; alt=&quot;Login HTML Template&quot; /&gt;&lt;/p&gt;
&lt;p&gt;On the form post, the form is valid. In our case make sure to fill the two fields and you will get &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/form_validation.jpg&quot; alt=&quot;Form Validation&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In case your username is polo, and you forgot the password. You will get the following message &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/form_invalid_message.jpg&quot; alt=&quot;Form Invalid Message&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Using Our Own Form Validation&lt;/h3&gt;
&lt;p&gt;In the above example, when validating the form &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;MyLoginForm.is_valid()
&lt;/pre&gt;
&lt;p&gt;We only used Django self-form validation engine, in our case just making sure the fields are required. Now let&amp;rsquo;s try to make sure the user trying to login is present in our DB as Dreamreal entry. For this, change the myapp/forms.py to &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;com&quot;&gt;#-*- coding: utf-8 -*-&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; forms
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myapp&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;models &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Dreamreal&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;LoginForm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;forms&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Form&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   user &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; forms&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;CharField&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;max_length &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   password &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; forms&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;CharField&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;widget &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; forms&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;PasswordInput&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;())&lt;/span&gt;

   &lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; clean_message&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      username &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;cleaned_data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;username&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      dbuser &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Dreamreal&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;objects&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; username&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
      
      &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;not&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dbuser&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;raise&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; forms&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;ValidationError&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;User does not exist in our db!&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; username&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Now, after calling the &quot;is_valid&quot; method, we will get the correct output, only if the user is in our database. If you want to check a field of your form, just add a method starting by &quot;clean_&quot; then your field name to your form class. Raising a forms.ValidationError is important.&lt;/p&gt;

&lt;h1&gt;File Uploading&lt;/h1&gt;
&lt;p&gt;It is generally useful for a web app to be able to upload files (profile picture, songs, pdf, words.....). Let&#39;s discuss how to upload files in this chapter.&lt;/p&gt;
&lt;h2&gt;Uploading an Image&lt;/h2&gt;
&lt;p&gt;Before starting to play with an image, make sure you have the Python Image Library (PIL) installed. Now to illustrate uploading an image, let&#39;s create a profile form, in our myapp/forms.py &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;com&quot;&gt;#-*- coding: utf-8 -*-&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; forms

&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;ProfileForm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;forms&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Form&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; forms&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;CharField&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;max_length &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   picture &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; forms&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;ImageFields&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;As you can see, the main difference here is just the&amp;nbsp;&lt;strong&gt;forms.ImageField&lt;/strong&gt;. ImageField will make sure the uploaded file is an image. If not, the form validation will fail.&lt;/p&gt;
&lt;p&gt;Now let&#39;s create a &quot;Profile&quot; model to save our uploaded profile. This is done in myapp/models.py &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;db &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; models

&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Profile&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;models&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Model&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; models&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;CharField&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;max_length &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   picture &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; models&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;ImageField&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;upload_to &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;pictures&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;

   &lt;span class=&quot;kwd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Meta&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      db_table &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;profile&quot;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;As you can see for the model, the ImageField takes a compulsory argument:&amp;nbsp;&lt;strong&gt;upload_to&lt;/strong&gt;. This represents the place on the hard drive where your images will be saved. Note that the parameter will be added to the MEDIA_ROOT option defined in your settings.py file.&lt;/p&gt;
&lt;p&gt;Now that we have the Form and the Model, let&#39;s create the view, in myapp/views.py &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;com&quot;&gt;#-*- coding: utf-8 -*-&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myapp&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;forms &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;ProfileForm&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myapp&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;models &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Profile&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;SaveProfile&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   saved &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;False&lt;/span&gt;
   
   &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;method &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;POST&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;com&quot;&gt;#Get the posted form&lt;/span&gt;
      &lt;span class=&quot;typ&quot;&gt;MyProfileForm&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;ProfileForm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;POST&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;FILES&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
      
      &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;MyProfileForm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;is_valid&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;():&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         profile &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Profile&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         profile&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;MyProfileForm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;cleaned_data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         profile&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;picture &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;MyProfileForm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;cleaned_data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;picture&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         profile&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;save&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         saved &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;True&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;typ&quot;&gt;MyProfileForm&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Profileform&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;
		
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; render&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;saved.html&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; locals&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;())&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The part not to miss is, there is a change when creating a ProfileForm, we added a second parameters:&amp;nbsp;&lt;strong&gt;request.FILES&lt;/strong&gt;. If not passed the form validation will fail, giving a message that says the picture is empty.&lt;/p&gt;
&lt;p&gt;Now, we just need the&amp;nbsp;&lt;strong&gt;saved.html&lt;/strong&gt;&amp;nbsp;template and the&amp;nbsp;&lt;strong&gt;profile.html&lt;/strong&gt;&amp;nbsp;template, for the form and the redirection page &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;myapp/templates/saved.html&lt;/strong&gt;&amp;nbsp;&amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   
      {% if saved %}
         &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;strong&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Your profile was saved.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/strong&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      {% endif %}
      
      {% if not saved %}
         &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;strong&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Your profile was not saved.&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/strong&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      {% endif %}
      
   &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;myapp/templates/profile.html&lt;/strong&gt;&amp;nbsp;&amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
   
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;form&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;form&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;enctype&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;multipart/form-data&quot;&lt;/span&gt; 
         &lt;span class=&quot;atn&quot;&gt;action&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;{% url &quot;&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;myapp&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;views&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;SaveProfile&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot; %}&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;method&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;POST&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;{% csrf_token %}
         
         &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;max&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;470px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;center&amp;gt;&lt;/span&gt;  
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; 
               &lt;span class=&quot;atn&quot;&gt;placeholder&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Name&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;name&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/center&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
			
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;br&amp;gt;&lt;/span&gt;
         
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;max&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;470px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;center&amp;gt;&lt;/span&gt; 
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;file&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; 
                  &lt;span class=&quot;atn&quot;&gt;placeholder&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Picture&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;picture&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/center&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
			
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;br&amp;gt;&lt;/span&gt;
         
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;max&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;470px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;center&amp;gt;&lt;/span&gt; 
            
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:#&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;4285F4&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; margin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
                  height&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;35px&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; width&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;80&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; margin&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;19&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%;&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;submit&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Login&quot;&lt;/span&gt; &lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;
                  &lt;span class=&quot;tag&quot;&gt;&amp;lt;strong&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Login&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/strong&amp;gt;&lt;/span&gt;
               &lt;span class=&quot;tag&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
               
            &lt;span class=&quot;tag&quot;&gt;&amp;lt;/center&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
         
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;
      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Next, we need our pair of URLs to get started: myapp/urls.py&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;conf&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;urls &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;views&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;generic&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;TemplateView&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

urlpatterns &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;myapp.views&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^profile/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;TemplateView&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;as_view&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      template_name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;profile.html&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^saved/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;SaveProfile&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;saved&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;When accessing &quot;/myapp/profile&quot;, we will get the following profile.html template rendered &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/uploading_image.jpg&quot; alt=&quot;Uploading Image&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And on form post, the saved template will be rendered &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/form_post_template.jpg&quot; alt=&quot;Form Post Template&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We have a sample for image, but if you want to upload another type of file, not just image, just replace the&amp;nbsp;&lt;strong&gt;ImageField&lt;/strong&gt;&amp;nbsp;in both Model and Form with&amp;nbsp;&lt;strong&gt;FileField&lt;/strong&gt;.&lt;/p&gt;

&lt;h1&gt;Apache Setup&lt;/h1&gt;

&lt;p&gt;So far, in our examples, we have used the Django dev web server. But this server is just for testing and is not fit for production environment. Once in production, you need a real server like Apache, Nginx, etc. Let&#39;s discuss Apache in this chapter.&lt;/p&gt;
&lt;p&gt;Serving Django applications via Apache is done by using mod_wsgi. So the first thing is to make sure you have Apache and mod_wsgi installed. Remember, when we created our project and we looked at the project structure, it looked like &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;myproject/
   manage.py
   myproject/
      __init__.py
      settings.py
      urls.py
      wsgi.py
&lt;/pre&gt;
&lt;p&gt;The wsgi.py file is the one taking care of the link between Django and Apache.&lt;/p&gt;
&lt;p&gt;Let&#39;s say we want to share our project (myproject) with Apache. We just need to set Apache to access our folder. Assume we put our myproject folder in the default &quot;/var/www/html&quot;. At this stage, accessing the project will be done via 127.0.0.1/myproject. This will result in Apache just listing the folder as shown in the following snapshot.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/django_apache_setup.jpg&quot; alt=&quot;Django Apache Setup&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As seen, Apache is not handling Django stuff. For this to be taken care of, we need to configure Apache in httpd.conf. So open the httpd.conf and add the following line &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;typ&quot;&gt;WSGIScriptAlias&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;/ /&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;www&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;myproject&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;myproject&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;wsgi&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;py
&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;WSGIPythonPath&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;www&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;myproject&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;

&lt;span class=&quot;pun&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Directory&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;www&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;myproject&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;/&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Files&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; wsgi&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;py&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;typ&quot;&gt;Order&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; deny&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;allow
      &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Allow&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; all
   &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Files&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Directory&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;If you can access the login page as 127.0.0.1/myapp/connection, you will get to see the following page &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/login_page.jpg&quot; alt=&quot;Login Page&quot; /&gt;&lt;/p&gt;

&lt;h1&gt;Cookies Handling&lt;/h1&gt;

&lt;p&gt;Sometimes you might want to store some data on a per-site-visitor basis as per the requirements of your web application. Always keep in mind, that cookies are saved on the client side and depending on your client browser security level, setting cookies can at times work and at times might not.&lt;/p&gt;
&lt;p&gt;To illustrate cookies handling in Django, let&#39;s create a system using the login system we created before. The system will keep you logged in for X minute of time, and beyond that time, you will be out of the app.&lt;/p&gt;
&lt;p&gt;For this, you will need to set up two cookies, last_connection and username.&lt;/p&gt;
&lt;p&gt;At first, let&#39;s change our login view to store our username and last_connection cookies &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;template&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;RequestContext&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; login&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   username &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;not logged in&quot;&lt;/span&gt;
   
   &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;method &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;POST&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;com&quot;&gt;#Get the posted form&lt;/span&gt;
      &lt;span class=&quot;typ&quot;&gt;MyLoginForm&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;LoginForm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;POST&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
   
   &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;MyLoginForm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;is_valid&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;():&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      username &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;MyLoginForm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;cleaned_data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;username&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;typ&quot;&gt;MyLoginForm&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;LoginForm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   
   response &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; render_to_response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;loggedin.html&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;username&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; username&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
      context_instance &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;RequestContext&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   
   response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;set_cookie&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;last_connection&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; datetime&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;datetime&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;now&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;())&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;set_cookie&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;username&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; datetime&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;datetime&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;now&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;())&lt;/span&gt;
	
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; response&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;As seen in the view above, setting cookie is done by the&amp;nbsp;&lt;strong&gt;set_cookie&lt;/strong&gt;&amp;nbsp;method called on the response not the request, and also note that all cookies values are returned as string.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s now create a formView for the login form, where we won&amp;rsquo;t display the form if cookie is set and is not older than 10 second &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; formView&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;username&#39;&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;COOKIES &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;last_connection&#39;&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;COOKIES&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      username &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;COOKIES&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;username&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      
      last_connection &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;COOKIES&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;last_connection&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      last_connection_time &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; datetime&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;datetime&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;strptime&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;last_connection&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[:-&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;],&lt;/span&gt; 
         &lt;span class=&quot;str&quot;&gt;&quot;%Y-%m-%d %H:%M:%S&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
      
      &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;datetime&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;datetime&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;now&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; last_connection_time&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;seconds &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; render&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;loggedin.html&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;username&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; username&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;
         &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; render&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;login.html&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{})&lt;/span&gt;
			
   &lt;span class=&quot;kwd&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; render&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;login.html&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{})&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;As you can see in the formView above accessing the cookie you set, is done via the COOKIES attribute (dict) of the request.&lt;/p&gt;
&lt;p&gt;Now let&amp;rsquo;s change the url.py file to change the URL so it pairs with our new view &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;conf&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;urls &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;views&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;generic&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;TemplateView&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

urlpatterns &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;myapp.views&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^connection/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;formView&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;loginform&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^login/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;login&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;login&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;))&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;When accessing /myapp/connection, you will get the following page &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/django_cookies_handling.jpg&quot; alt=&quot;Django Cookies Handling&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And you will get redirected to the following screen on submit &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/cookies_handling_redirected_page.jpg&quot; alt=&quot;Cookies Handling Redirected Page&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now, if you try to access /myapp/connection again in the 10 seconds range, you will get redirected to the second screen directly. And if you access /myapp/connection again out of this range you will get the login form (screen 1)&lt;/p&gt;

&lt;h1&gt;Session&lt;/h1&gt;
&lt;p&gt;As discussed earlier, we can use client side cookies to store a lot of useful data for the web app. We have seen before that we can use client side cookies to store various data useful for our web app. This leads to lot of security holes depending on the importance of the data you want to save.&lt;/p&gt;
&lt;p&gt;For security reasons, Django has a session framework for cookies handling. Sessions are used to abstract the receiving and sending of cookies, data is saved on server side (like in database), and the client side cookie just has a session ID for identification. Sessions are also useful to avoid cases where the user browser is set to &amp;lsquo;not accept&amp;rsquo; cookies.&lt;/p&gt;
&lt;h2&gt;Setting Up Sessions&lt;/h2&gt;
&lt;p&gt;In Django, enabling session is done in your project&amp;nbsp;&lt;strong&gt;settings.py&lt;/strong&gt;, by adding some lines to the&amp;nbsp;&lt;strong&gt;MIDDLEWARE_CLASSES&lt;/strong&gt;&amp;nbsp;and the&amp;nbsp;&lt;strong&gt;INSTALLED_APPS&lt;/strong&gt;&amp;nbsp;options. This should be done while creating the project, but it&#39;s always good to know, so&amp;nbsp;&lt;strong&gt;MIDDLEWARE_CLASSES&lt;/strong&gt;should have &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&#39;django.contrib.sessions.middleware.SessionMiddleware&#39;
&lt;/pre&gt;
&lt;p&gt;And&amp;nbsp;&lt;strong&gt;INSTALLED_APPS&lt;/strong&gt;&amp;nbsp;should have &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;&#39;django.contrib.sessions&#39;
&lt;/pre&gt;
&lt;p&gt;By default, Django saves session information in database (django_session table or collection), but you can configure the engine to store information using other ways like: in&amp;nbsp;&lt;strong&gt;file&lt;/strong&gt;&amp;nbsp;or in&amp;nbsp;&lt;strong&gt;cache&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;When session is enabled, every request (first argument of any view in Django) has a session (dict) attribute.&lt;/p&gt;
&lt;p&gt;Let&#39;s create a simple sample to see how to create and save sessions. We have built a simple login system before (see Django form processing chapter and Django Cookies Handling chapter). Let us save the username in a cookie so, if not signed out, when accessing our login page you won&amp;rsquo;t see the login form. Basically, let&#39;s make our login system we used in Django Cookies handling more secure, by saving cookies server side.&lt;/p&gt;
&lt;p&gt;For this, first lets change our login view to save our username cookie server side &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; login&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   username &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;not logged in&#39;&lt;/span&gt;
   
   &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;method &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;POST&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;typ&quot;&gt;MyLoginForm&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;LoginForm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;POST&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
      
      &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;MyLoginForm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;is_valid&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;():&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         username &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;MyLoginForm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;cleaned_data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;username&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;session&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;username&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; username
      &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;
         &lt;span class=&quot;typ&quot;&gt;MyLoginForm&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;LoginForm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;
			
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; render&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;loggedin.html&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;username&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; username&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Then let us create formView view for the login form, where we won&amp;rsquo;t display the form if cookie is set &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; formView&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;session&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;has_key&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;username&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      username &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;session&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;username&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; render&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;loggedin.html&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;username&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; username&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; render&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;login.html&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{})&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Now let us change the url.py file to change the url so it pairs with our new view &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;conf&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;urls &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;views&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;generic&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;TemplateView&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

urlpatterns &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;myapp.views&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^connection/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;formView&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;loginform&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^login/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;login&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;login&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;))&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;When accessing /myapp/connection, you will get to see the following page &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/setting_up_sessions.jpg&quot; alt=&quot;Setting Up Sessions&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And you will get redirected to the following page &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/sessions_redirected_page.jpg&quot; alt=&quot;Sessions Redirected Page&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now if you try to access /myapp/connection again, you will get redirected to the second screen directly.&lt;/p&gt;
&lt;p&gt;Let&#39;s create a simple logout view that erases our cookie.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; logout&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;del&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;session&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;username&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;except&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;pass&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&amp;lt;strong&amp;gt;You are logged out.&amp;lt;/strong&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;And pair it with a logout URL in myapp/url.py&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;url(r&#39;^logout/&#39;, &#39;logout&#39;, name = &#39;logout&#39;),
&lt;/pre&gt;
&lt;p&gt;Now, if you access /myapp/logout, you will get the following page &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/logged_out_page.jpg&quot; alt=&quot;Logged Out Page&quot; /&gt;&lt;/p&gt;
&lt;p&gt;If you access /myapp/connection again, you will get the login form (screen 1).&lt;/p&gt;
&lt;h3&gt;Some More Possible Actions Using Sessions&lt;/h3&gt;
&lt;p&gt;We have seen how to store and access a session, but it&#39;s good to know that the session attribute of the request have some other useful actions like &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;set_expiry (&lt;em&gt;value&lt;/em&gt;)&lt;/strong&gt;&amp;nbsp;&amp;minus; Sets the expiration time for the session.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;get_expiry_age()&lt;/strong&gt;&amp;nbsp;&amp;minus; Returns the number of seconds until this session expires.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;get_expiry_date()&lt;/strong&gt;&amp;nbsp;&amp;minus; Returns the date this session will expire.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;clear_expired()&lt;/strong&gt;&amp;nbsp;&amp;minus; Removes expired sessions from the session store.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;get_expire_at_browser_close()&lt;/strong&gt;&amp;nbsp;&amp;minus; Returns either True or False, depending on whether the user&amp;rsquo;s session cookies have expired when the user&amp;rsquo;s web browser is closed.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;Caching&lt;/h1&gt;
&lt;p&gt;To cache something is to save the result of an expensive calculation, so that you don&amp;rsquo;t perform it the next time you need it. Following is a pseudo code that explains how caching works &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;given a URL&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; finding that page &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; the cache

&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; the page &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; the cache&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; the cached page
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   generate the page
   save the generated page &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; the cache &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; time&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; the generated page&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Django comes with its own caching system that lets you save your dynamic pages, to avoid calculating them again when needed. The good point in Django Cache framework is that you can cache &amp;minus;&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;The output of a specific view.&lt;/li&gt;
&lt;li&gt;A part of a template.&lt;/li&gt;
&lt;li&gt;Your entire site.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To use cache in Django, first thing to do is to set up where the cache will stay. The cache framework offers different possibilities - cache can be saved in database, on file system or directly in memory. Setting is done in the&amp;nbsp;&lt;strong&gt;settings.py&lt;/strong&gt;&amp;nbsp;file of your project.&lt;/p&gt;
&lt;h2&gt;Setting Up Cache in Database&lt;/h2&gt;
&lt;p&gt;Just add the following in the project settings.py file &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;CACHES &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;default&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;str&quot;&gt;&#39;BACKEND&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;django.core.cache.backends.db.DatabaseCache&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;str&quot;&gt;&#39;LOCATION&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;my_table_name&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;For this to work and to complete the setting, we need to create the cache table &#39;my_table_name&#39;. For this, you need to do the following &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;python manage.py createcachetable
&lt;/pre&gt;
&lt;h2&gt;Setting Up Cache in File System&lt;/h2&gt;
&lt;p&gt;Just add the following in the project settings.py file &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;CACHES &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;default&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;str&quot;&gt;&#39;BACKEND&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;django.core.cache.backends.filebased.FileBasedCache&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;str&quot;&gt;&#39;LOCATION&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;/var/tmp/django_cache&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;Setting Up Cache in Memory&lt;/h2&gt;
&lt;p&gt;This is the most efficient way of caching, to use it you can use one of the following options depending on the Python binding library you choose for the memory cache &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;CACHES &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;default&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;str&quot;&gt;&#39;BACKEND&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;django.core.cache.backends.memcached.MemcachedCache&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;str&quot;&gt;&#39;LOCATION&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;127.0.0.1:11211&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Or&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;CACHES &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;default&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;str&quot;&gt;&#39;BACKEND&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;django.core.cache.backends.memcached.MemcachedCache&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;str&quot;&gt;&#39;LOCATION&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;unix:/tmp/memcached.sock&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;Caching the Entire Site&lt;/h2&gt;
&lt;p&gt;The simplest way of using cache in Django is to cache the entire site. This is done by editing the MIDDLEWARE_CLASSES option in the project settings.py. The following need to be added to the option &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;MIDDLEWARE_CLASSES &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.middleware.cache.UpdateCacheMiddleware&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.middleware.common.CommonMiddleware&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.middleware.cache.FetchFromCacheMiddleware&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Note that the order is important here, Update should come before Fetch middleware.&lt;/p&gt;
&lt;p&gt;Then in the same file, you need to set &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;CACHE_MIDDLEWARE_ALIAS &amp;ndash; The cache alias to use for storage.
CACHE_MIDDLEWARE_SECONDS &amp;ndash; The number of seconds each page should be cached.
&lt;/pre&gt;
&lt;h2&gt;Caching a View&lt;/h2&gt;
&lt;p&gt;If you don&amp;rsquo;t want to cache the entire site you can cache a specific view. This is done by using the&amp;nbsp;&lt;strong&gt;cache_page&lt;/strong&gt;&amp;nbsp;decorator that comes with Django. Let us say we want to cache the result of the&amp;nbsp;&lt;strong&gt;viewArticles&lt;/strong&gt;&amp;nbsp;view &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;views&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;decorators&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;cache &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; cache_page

&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;@cache_page&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;60&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; viewArticles&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; year&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; month&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   text &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Displaying articles of : %s/%s&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;year&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; month&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;As you can see&amp;nbsp;&lt;strong&gt;cache_page&lt;/strong&gt;&amp;nbsp;takes the number of seconds you want the view result to be cached as parameter. In our example above, the result will be cached for 15 minutes.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&amp;nbsp;&amp;minus; As we have seen before the above view was map to &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;urlpatterns &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;myapp.views&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^articles/(?P&amp;lt;month&amp;gt;\d{2})/(?P&amp;lt;year&amp;gt;\d{4})/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;viewArticles&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;articles&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Since the URL is taking parameters, each different call will be cached separately. For example, request to /myapp/articles/02/2007 will be cached separately to /myapp/articles/03/2008.&lt;/p&gt;
&lt;p&gt;Caching a view can also directly be done in the url.py file. Then the following has the same result as the above. Just edit your myapp/url.py file and change the related mapped URL (above) to be &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;urlpatterns &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;myapp.views&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^articles/(?P&amp;lt;month&amp;gt;\d{2})/(?P&amp;lt;year&amp;gt;\d{4})/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
   cache_page&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;60&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;viewArticles&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;articles&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;And, of course, it&#39;s no longer needed in myapp/views.py.&lt;/p&gt;
&lt;h2&gt;Caching a Template Fragment&lt;/h2&gt;
&lt;p&gt;You can also cache parts of a template, this is done by using the&amp;nbsp;&lt;strong&gt;cache&lt;/strong&gt;&amp;nbsp;tag. Let&#39;s take our&amp;nbsp;&lt;strong&gt;hello.html&lt;/strong&gt;&amp;nbsp;template &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;main_template.html&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; block title &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;My&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Hello&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Page&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; endblock &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; block content &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;

&lt;span class=&quot;typ&quot;&gt;Hello&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;World&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;!!!&amp;lt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Today&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;today&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}}&amp;lt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;typ&quot;&gt;We&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; are
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; today&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;day &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

the first day of month&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;elif&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; today &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;30&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

the &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;last&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; day of month&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

I don&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;t know.
{%endif%}

&amp;lt;p&amp;gt;
   {% for day in days_of_week %}
   {{day}}
&amp;lt;/p&amp;gt;

{% endfor %}
{% endblock %}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;And to cache the content block, our template will become &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; load cache &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;main_template.html&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; block title &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;My&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Hello&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Page&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; endblock &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; cache &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;500&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; content &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; block content &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;

&lt;span class=&quot;typ&quot;&gt;Hello&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;World&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;!!!&amp;lt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Today&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;today&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}}&amp;lt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;typ&quot;&gt;We&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; are
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; today&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;day &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

the first day of month&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;elif&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; today &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;30&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

the &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;last&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; day of month&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

I don&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;t know.
{%endif%}

&amp;lt;p&amp;gt;
   {% for day in days_of_week %}
   {{day}}
&amp;lt;/p&amp;gt;

{% endfor %}
{% endblock %}
{% endcache %}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;As you can see above, the cache tag will take 2 parameters &amp;minus; the time you want the block to be cached (in seconds) and the name to be given to the cache fragment.&lt;/p&gt;

&lt;h1&gt;Comments&lt;/h1&gt;
&lt;p&gt;Before starting, note that the Django Comments framework is deprecated, since the 1.5 version. Now you can use external feature for doing so, but if you still want to use it, it&#39;s still included in version 1.6 and 1.7. Starting version 1.8 it&#39;s absent but you can still get the code on a different GitHub account.&lt;/p&gt;
&lt;p&gt;The comments framework makes it easy to attach comments to any model in your app.&lt;/p&gt;
&lt;p&gt;To start using the Django comments framework &amp;minus;&lt;/p&gt;
&lt;p&gt;Edit the project settings.py file and add&amp;nbsp;&lt;strong&gt;&#39;django.contrib.sites&#39;&lt;/strong&gt;, and&amp;nbsp;&lt;strong&gt;&#39;django.contrib.comments&#39;&lt;/strong&gt;, to INSTALLED_APPS option &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;INSTALLED_APPS &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;django.contrib.sites&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;django.contrib.comments&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Get the site id &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;contrib&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;sites&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;models &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Site&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Site&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;save&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Site&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;objects&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;all&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()[&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;id
u&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;56194498e13823167dd43c64&#39;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Set the id you get in the settings.py file &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;SITE_ID = u&#39;56194498e13823167dd43c64&#39;
&lt;/pre&gt;
&lt;p&gt;Sync db, to create all the comments table or collection &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;python manage.py syncdb
&lt;/pre&gt;
&lt;p&gt;Add the comment app&amp;rsquo;s URLs to your project&amp;rsquo;s urls.py &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;conf&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;urls &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; include
url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^comments/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; include&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;django.contrib.comments.urls&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)),&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Now that we have the framework installed, let&#39;s change our hello templates to tracks comments on our Dreamreal model. We will list, save comments for a specific Dreamreal entry whose name will be passed as parameter to the /myapp/hello URL.&lt;/p&gt;
&lt;h2&gt;Dreamreal Model&lt;/h2&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Dreamreal&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;models&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Model&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

   website &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; models&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;CharField&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;max_length &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   mail &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; models&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;CharField&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;max_length &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; models&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;CharField&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;max_length &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   phonenumber &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; models&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;IntegerField&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;

   &lt;span class=&quot;kwd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Meta&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      db_table &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;dreamreal&quot;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;hello view&lt;/h2&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; hello&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   today &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; datetime&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;datetime&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;now&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;date&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   daysOfWeek &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Mon&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Tue&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Wed&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Thu&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Fri&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Sat&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;Sun&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   dreamreal &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Dreamreal&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;objects&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; render&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;hello.html&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; locals&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;())&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;hello.html template&lt;/h2&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt; &lt;span class=&quot;kwd&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;main_template.html&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; load comments &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; block title &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;My&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Hello&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Page&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; endblock &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; block content &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;

&lt;span class=&quot;str&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;typ&quot;&gt;Our&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Dreamreal&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Entry&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Name&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;:&amp;lt;&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;/strong&amp;gt; {{dreamreal.name}}&amp;lt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Website&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;:&amp;lt;&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;/strong&amp;gt; {{dreamreal.website}}&amp;lt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Phone&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;:&amp;lt;&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;/strong&amp;gt; {{dreamreal.phonenumber}}&amp;lt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Number&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; of comments &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&amp;lt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;strong&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt; 
   &lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; get_comment_count &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dreamreal &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;as&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; comment_count &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; comment_count &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}}&amp;lt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; of comments &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&amp;lt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; render_comment_list &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dreamreal &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;

&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; render_comment_form &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dreamreal &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; endblock &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Finally the mapping URL to our hello view &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;url(r&#39;^hello/(?P&amp;lt;Name&amp;gt;\w+)/&#39;, &#39;hello&#39;, name = &#39;hello&#39;),
&lt;/pre&gt;
&lt;p&gt;Now,&lt;/p&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;In our template (hello.html), load the comments framework with &amp;minus; {% load comments %}&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;We get the number of comments for the Dreamreal object pass by the view &amp;minus; {% get_comment_count for dreamreal as comment_count %}&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;We get the list of comments for the objects &amp;minus; {% render_comment_list for dreamreal %}&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;We display the default comments form &amp;minus; {% render_comment_form for dreamreal %}&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When accessing /myapp/hello/steve you will get the comments info for the Dreamreal entry whose name is Steve. Accessing that URL will get you &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/django_comments_example.jpg&quot; alt=&quot;Django Comments Example&quot; /&gt;&lt;/p&gt;
&lt;p&gt;On posting a comment, you will get redirected to the following page &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/comments_redirected_page.jpg&quot; alt=&quot;Comments Redirected Page&quot; /&gt;&lt;/p&gt;
&lt;p&gt;If you go to /myapp/hello/steve again, you will get to see the following page &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/number_of_comments.jpg&quot; alt=&quot;Number of Comments&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As you can see, the number of comments is 1 now and you have the comment under the list of comments line.&lt;/p&gt;

&lt;h1&gt;RSS&lt;/h1&gt;
&lt;p&gt;Django comes with a syndication feed generating framework. With it you can create RSS or Atom feeds just by subclassing&amp;nbsp;&lt;strong&gt;&lt;em&gt;django.contrib.syndication.views.Feed class&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Let&#39;s create a feed for the latest comments done on the app (Also see Django - Comments Framework chapter). For this, let&#39;s create a myapp/feeds.py and define our feed (You can put your feeds classes anywhere you want in your code structure).&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;contrib&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;syndication&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;views &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Feed&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;contrib&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;comments &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Comment&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;core&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;urlresolvers &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; reverse

&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;DreamrealCommentsFeed&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Feed&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   title &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Dreamreal&#39;s comments&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   link &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;/drcomments/&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   description &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&quot;Updates on new comments on Dreamreal entry.&quot;&lt;/span&gt;

   &lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; items&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Comment&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;objects&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;all&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;order_by&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;-submit_date&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)[:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;
		
   &lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; item_title&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; item&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; item&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;user_name
		
   &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; item_description&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; item&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; item&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;comment
		
   &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; item_link&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; item&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; reverse&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;comment&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; kwargs &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;object_pk&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;pk&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;})&lt;/span&gt;&lt;/pre&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;
&lt;p&gt;In our feed class,&amp;nbsp;&lt;strong&gt;title&lt;/strong&gt;,&amp;nbsp;&lt;strong&gt;link&lt;/strong&gt;, and&amp;nbsp;&lt;strong&gt;description&lt;/strong&gt;&amp;nbsp;attributes correspond to the standard RSS&amp;nbsp;&lt;strong&gt;&amp;lt;title&amp;gt;&lt;/strong&gt;,&amp;nbsp;&lt;strong&gt;&amp;lt;link&amp;gt;&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;&amp;lt;description&amp;gt;&lt;/strong&gt;&amp;nbsp;elements.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;items&lt;/strong&gt;&amp;nbsp;method, return the elements that should go in the feed as item element. In our case the last five comments.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;item_title&lt;/strong&gt;&amp;nbsp;method, will get what will go as title for our feed item. In our case the title, will be the user name.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;item_description&lt;/strong&gt;&amp;nbsp;method, will get what will go as description for our feed item. In our case the comment itself.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;item_link&lt;/strong&gt;&amp;nbsp;method will build the link to the full item. In our case it will get you to the comment.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Now that we have our feed, let&#39;s add a comment view in views.py to display our comment &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;contrib&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;comments &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Comment&lt;/span&gt;

&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; comment&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; object_pk&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   mycomment &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Comment&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;objects&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;object_pk &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; object_pk&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   text &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;strong&amp;gt;User :&amp;lt;/strong&amp;gt; %s &amp;lt;p&amp;gt;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;mycomment&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;user_name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   text &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;strong&amp;gt;Comment :&amp;lt;/strong&amp;gt; %s &amp;lt;p&amp;gt;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;mycomment&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;comment&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;HttpResponse&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We also need some URLs in our myapp urls.py for mapping &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myapp&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;feeds &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;DreamrealCommentsFeed&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;conf&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;urls &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url

urlpatterns &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^latest/comments/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;DreamrealCommentsFeed&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^comment/(?P\w+)/&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;comment&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;comment&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;When accessing /myapp/latest/comments/ you will get our feed &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/django_rss_example.jpg&quot; alt=&quot;Django RSS Example&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Then clicking on one of the usernames will get you to: /myapp/comment/comment_id as defined in our comment view before and you will get &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/django_rss_redirected_page.jpg&quot; alt=&quot;Django RSS Redirected Page&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Thus, defining a RSS feed is just a matter of sub-classing the Feed class and making sure the URLs (one for accessing the feed and one for accessing the feed elements) are defined. Just as comment, this can be attached to any model in your app.&lt;/p&gt;

&lt;h1&gt;AJAX&lt;/h1&gt;
&lt;p&gt;Ajax essentially is a combination of technologies that are integrated together to reduce the number of page loads. We generally use Ajax to ease end-user experience. Using Ajax in Django can be done by directly using an Ajax library like JQuery or others. Let&#39;s say you want to use JQuery, then you need to download and serve the library on your server through Apache or others. Then use it in your template, just like you might do while developing any Ajax-based application.&lt;/p&gt;
&lt;p&gt;Another way of using Ajax in Django is to use the Django Ajax framework. The most commonly used is django-dajax which is a powerful tool to easily and super-quickly develop asynchronous presentation logic in web applications, using Python and almost no JavaScript source code. It supports four of the most popular Ajax frameworks: Prototype, jQuery, Dojo and MooTools.&lt;/p&gt;
&lt;h2&gt;Using Django-dajax&lt;/h2&gt;
&lt;p&gt;First thing to do is to install django-dajax. This can be done using easy_install or pip &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;$ pip install django_dajax
$ easy_install django_dajax
&lt;/pre&gt;
&lt;p&gt;This will automatically install django-dajaxice, required by django-dajax. We then need to configure both dajax and dajaxice.&lt;/p&gt;
&lt;p&gt;Add dajax and dajaxice in your project settings.py in INSTALLED_APPS option &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;INSTALLED_APPS &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;dajaxice&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;dajax&#39;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Make sure in the same settings.py file, you have the following &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pln&quot;&gt;TEMPLATE_LOADERS &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.template.loaders.filesystem.Loader&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.template.loaders.app_directories.Loader&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.template.loaders.eggs.Loader&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

TEMPLATE_CONTEXT_PROCESSORS &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.contrib.auth.context_processors.auth&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.core.context_processors.debug&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.core.context_processors.i18n&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.core.context_processors.media&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.core.context_processors.static&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.core.context_processors.request&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.contrib.messages.context_processors.messages&#39;&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

STATICFILES_FINDERS &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.contrib.staticfiles.finders.FileSystemFinder&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;django.contrib.staticfiles.finders.AppDirectoriesFinder&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
   &lt;span class=&quot;str&quot;&gt;&#39;dajaxice.finders.DajaxiceFinder&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

DAJAXICE_MEDIA_PREFIX &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;dajaxice&#39;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Now go to the myapp/url.py file and make sure you have the following to set dajax URLs and to load dajax statics js files &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dajaxice&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;core &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dajaxice_autodiscover&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dajaxice_config
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;contrib&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;staticfiles&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;urls &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; staticfiles_urlpatterns
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; django&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;conf &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; settings

&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Then&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dajax urls&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

urlpatterns &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; patterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;^%s/&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; settings&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;DAJAXICE_MEDIA_PREFIX&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; include&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;dajaxice.urls&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)),)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
	
urlpatterns &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; staticfiles_urlpatterns&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Let us create a simple form based on our Dreamreal model to store it, using Ajax (means no refresh).&lt;/p&gt;
&lt;p&gt;At first, we need our Dreamreal form in myapp/form.py.&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;DreamrealForm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;forms&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Form&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   website &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; forms&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;CharField&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;max_length &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; forms&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;CharField&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;max_length &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   phonenumber &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; forms&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;CharField&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;max_length &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   email &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; forms&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;CharField&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;max_length &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;lit&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Then we need an ajax.py file in our application: myapp/ajax.py. That&#39;s where is our logic, that&#39;s where we put the function that will be saving our form then return the popup &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dajaxice&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;utils &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; deserialize_form
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myapp&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;form &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;DreamrealForm&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dajax&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;core &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Dajax&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; myapp&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;models &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Dreamreal&lt;/span&gt;

&lt;span class=&quot;lit&quot;&gt;@dajaxice_register&lt;/span&gt;
&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; send_form&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; form&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   dajax &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Dajax&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   form &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;DreamrealForm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;deserialize_form&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;form&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;))&lt;/span&gt;
   
   &lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; form&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;is_valid&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;():&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      dajax&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;remove_css_class&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;#my_form input&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;error&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      dr &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;Dreamreal&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      dr&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;website &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; form&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;cleaned_data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;website&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      dr&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; form&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;cleaned_data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;name&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      dr&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;phonenumber &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; form&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;cleaned_data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;phonenumber&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      dr&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;save&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      
      dajax&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Dreamreal Entry %s was successfully saved.&quot;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
         form&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;cleaned_data&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;name&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;))&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      dajax&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;remove_css_class&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;#my_form input&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;error&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;kwd&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; error &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; form&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;errors&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         dajax&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;add_css_class&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;#id_%s&#39;&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; error&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;error&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
			
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dajax&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Now let&#39;s create the dreamreal.html template, which has our form &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
   
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;form&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;action&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;method&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;post&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;my_form&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;accept-charset&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         {{ form.as_p }}
         &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;p&amp;gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;button&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;Send&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;onclick&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;send_form&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;tag&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;
      
   &lt;span class=&quot;tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Add the view that goes with the template in myapp/views.py &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; dreamreal&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   form &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;typ&quot;&gt;DreamrealForm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;
   &lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; render&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;str&quot;&gt;&#39;dreamreal.html&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; locals&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;())&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Add the corresponding URL in myapp/urls.py &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;url(r&#39;^dreamreal/&#39;, &#39;dreamreal&#39;, name = &#39;dreamreal&#39;),
&lt;/pre&gt;
&lt;p&gt;Now let&#39;s add the necessary in our template to make the Ajax work &amp;minus;&lt;/p&gt;
&lt;p&gt;At the top of the file add &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; load &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;
&lt;span class=&quot;pun&quot;&gt;{%&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; load dajaxice_templatetags &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;%}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;And in the &amp;lt;head&amp;gt; section of our dreamreal.html template add &amp;minus;&lt;/p&gt;
&lt;p&gt;We are using the JQuery library for this example, so add &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;{% static &#39;/static/jquery-1.11.3.min.js&#39; %}&quot;&lt;/span&gt; 
   &lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;charset&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;script&lt;/span&gt; &lt;span class=&quot;atn&quot;&gt;src&lt;/span&gt; &lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;atv&quot;&gt;&quot;{% static &#39;/static/dajax/jquery.dajax.core.js&#39; %}&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The Ajax function that will be called on click &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;script&amp;gt;&lt;/span&gt;

   &lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; send_form&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(){&lt;/span&gt;
      &lt;span class=&quot;typ&quot;&gt;Dajaxice&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;myapp&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;send_form&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Dajax&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;process&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,{&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;form&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;#my_form&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;serialize&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)});&lt;/span&gt;
   &lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Note that you need the &amp;ldquo;jquery-1.11.3.min.js&amp;rdquo; in your static files directory, and also the jquery.dajax.core.js. To make sure all dajax static files are served under your static directory, run &amp;minus;&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot;&gt;$python manage.py collectstatic
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&amp;nbsp;&amp;minus; Sometimes the jquery.dajax.core.js can be missing, if that happens, just download the source and take that file and put it under your static folder.&lt;/p&gt;
&lt;p&gt;You will get to see the following screen, upon accessing /myapp/dreamreal/ &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/using_django_dajax.jpg&quot; alt=&quot;Using Django-dajax&quot; /&gt;&lt;/p&gt;
&lt;p&gt;On submit, you will get the following screen &amp;minus;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.tutorialspoint.com/django/images/using_django_dajax_response.jpg&quot; alt=&quot;Using Django-dajax Response&quot; /&gt;&lt;/p&gt;
&lt;script&gt;mbtTOC();&lt;/script&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;http://feeds.feedburner.com/PostLinkSharing&lt;/div&gt;</description><link>https://plinksharing.blogspot.com/2021/02/django.html</link><author>noreply@blogger.com (Arakkha Sênâ)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiq8nRE8KuGeEydAHCiIiMd4kOPYvv41E7TS1P0itun5D7s6ywbJRsO8yFUc_F3JKT3EbdjUZTdgln5uncQrKLfd__ou9X_n7NsJTj7tUXbPXKZQLO5fqPdh8fboiBvm5u-CKGKBiTywq7l/s72-c/images.jpeg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1955839799848409424.post-6205377906970856629</guid><pubDate>Fri, 12 Feb 2021 01:21:00 +0000</pubDate><atom:updated>2021-02-11T20:34:33.283-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Css &amp; Jav</category><category domain="http://www.blogger.com/atom/ns#">Guide Ways</category><category domain="http://www.blogger.com/atom/ns#">Web Programs</category><title>CSS Tutorials</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSp2mZNIcYKdbaWCaygV8REpsbBJXJ2Huw2LCtg3XtomXaRSRKz-kLiwnHbObUlJIge93QK8Z_iLFamM3FTFN0I_crjd9NPtRntf2Hg8f0ys0fYpkCXh7BIxhJHhCsMKxf9eo9vKv_N5hz/s0/css-illustration.png&quot; style=&quot;display: block; padding: 1em 0; text-align: center; &quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; data-original-height=&quot;300&quot; data-original-width=&quot;800&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSp2mZNIcYKdbaWCaygV8REpsbBJXJ2Huw2LCtg3XtomXaRSRKz-kLiwnHbObUlJIge93QK8Z_iLFamM3FTFN0I_crjd9NPtRntf2Hg8f0ys0fYpkCXh7BIxhJHhCsMKxf9eo9vKv_N5hz/s0/css-illustration.png&quot;/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;mbtTOC&quot;&gt;
    &lt;button onclick=&quot;mbtToggle()&quot;&gt;Contents&lt;/button&gt;
    &lt;ol id=&quot;mbtTOC&quot;&gt;&lt;/ol&gt;
    &lt;/div&gt;
&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-family: helvetica;&quot;&gt;Introduction&lt;/span&gt;&lt;/strong&gt;&lt;/h1&gt;&lt;p&gt;&lt;strong style=&quot;font-family: sans-serif;&quot;&gt;C&lt;/strong&gt;&lt;span face=&quot;sans-serif&quot;&gt;ascading&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;font-family: sans-serif;&quot;&gt;S&lt;/strong&gt;&lt;span face=&quot;sans-serif&quot;&gt;tyle&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;font-family: sans-serif;&quot;&gt;S&lt;/strong&gt;&lt;span face=&quot;sans-serif&quot;&gt;heets, fondly referred to as CSS, is a simple design language intended to simplify the process of making web pages presentable.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-family: sans-serif;&quot;&gt;CSS handles the look and feel part of a web page. Using CSS, you can control the color of the text, the style of fonts, the spacing between paragraphs, how columns are sized and laid out, what background images or colors are used, layout designs,variations in display for different devices and screen sizes as well as a variety of other effects.&lt;/p&gt;&lt;p style=&quot;font-family: sans-serif;&quot;&gt;CSS is easy to learn and understand but it provides powerful control over the presentation of an HTML document. Most commonly, CSS is combined with the markup languages HTML or XHTML.&lt;/p&gt;&lt;h2 style=&quot;font-family: sans-serif;&quot;&gt;Advantages of CSS&lt;/h2&gt;&lt;ul class=&quot;list&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;CSS saves time&lt;/strong&gt;&amp;nbsp;− You can write CSS once and then reuse same sheet in multiple HTML pages. You can define a style for each HTML element and apply it to as many Web pages as you want.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Pages load faster&lt;/strong&gt;&amp;nbsp;− If you are using CSS, you do not need to write HTML tag attributes every time. Just write one CSS rule of a tag and apply it to all the occurrences of that tag. So less code means faster download times.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Easy maintenance&lt;/strong&gt;&amp;nbsp;− To make a global change, simply change the style, and all elements in all the web pages will be updated automatically.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Superior styles to HTML&lt;/strong&gt;&amp;nbsp;− CSS has a much wider array of attributes than HTML, so you can give a far better look to your HTML page in comparison to HTML attributes.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Multiple Device Compatibility&lt;/strong&gt;&amp;nbsp;− Style sheets allow content to be optimized for more than one type of device. By using the same HTML document, different versions of a website can be presented for handheld devices such as PDAs and cell phones or for printing.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Global web standards&lt;/strong&gt;&amp;nbsp;− Now HTML attributes are being deprecated and it is being recommended to use CSS. So its a good idea to start using CSS in all the HTML pages to make them compatible to future browsers.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2 style=&quot;font-family: sans-serif;&quot;&gt;Who Creates and Maintains CSS?&lt;/h2&gt;&lt;p style=&quot;font-family: sans-serif;&quot;&gt;CSS is created and maintained through a group of people within the W3C called the CSS Working Group. The CSS Working Group creates documents called specifications. When a specification has been discussed and officially ratified by the W3C members, it becomes a recommendation.&lt;/p&gt;&lt;p style=&quot;font-family: sans-serif;&quot;&gt;These ratified specifications are called recommendations because the W3C has no control over the actual implementation of the language. Independent companies and organizations create that software.&lt;/p&gt;&lt;p style=&quot;font-family: sans-serif;&quot;&gt;&lt;strong&gt;NOTE&lt;/strong&gt;&amp;nbsp;− The World Wide Web Consortium, or W3C is a group that makes recommendations about how the Internet works and how it should evolve.&lt;/p&gt;&lt;h2 style=&quot;font-family: sans-serif;&quot;&gt;CSS Versions&lt;/h2&gt;&lt;p style=&quot;font-family: sans-serif;&quot;&gt;Cascading Style Sheets level 1 (CSS1) came out of W3C as a recommendation in December 1996. This version describes the CSS language as well as a simple visual formatting model for all the HTML tags.&lt;/p&gt;&lt;p style=&quot;font-family: sans-serif;&quot;&gt;CSS2 became a W3C recommendation in May 1998 and builds on CSS1. This version adds support for media-specific style sheets e.g. printers and aural devices, downloadable fonts, element positioning and tables.&lt;/p&gt;&lt;h1 style=&quot;font-family: sans-serif; text-align: left;&quot;&gt;Syntax&lt;/h1&gt;&lt;h2 style=&quot;background-color: white; box-sizing: inherit; font-family: &amp;quot;Segoe UI&amp;quot;, Arial, sans-serif; font-size: 32px; font-weight: 400; margin: 10px 0px;&quot;&gt;CSS Syntax&lt;/h2&gt;&lt;p style=&quot;background-color: white; box-sizing: inherit; font-family: Verdana, sans-serif; font-size: 15px; margin-bottom: 1.2em; margin-top: 1.2em;&quot;&gt;A CSS rule-set consists of a selector and a declaration block:&lt;/p&gt;&lt;p style=&quot;background-color: white; box-sizing: inherit; font-family: Verdana, sans-serif; font-size: 15px; margin-bottom: 1.2em; margin-top: 1.2em;&quot;&gt;&lt;img alt=&quot;CSS selector&quot; class=&quot;w3-image&quot; src=&quot;https://www.w3schools.com/css/selector.gif&quot; style=&quot;border-style: none; box-sizing: inherit; height: auto; max-width: 100%;&quot; /&gt;&lt;/p&gt;&lt;p style=&quot;background-color: white; box-sizing: inherit; font-family: Verdana, sans-serif; font-size: 15px; margin-bottom: 1.2em; margin-top: 1.2em;&quot;&gt;The selector points to the HTML element you want to style.&lt;/p&gt;&lt;p style=&quot;background-color: white; box-sizing: inherit; font-family: Verdana, sans-serif; font-size: 15px; margin-bottom: 1.2em; margin-top: 1.2em;&quot;&gt;The declaration block contains one or more declarations separated by semicolons.&lt;/p&gt;&lt;p style=&quot;background-color: white; box-sizing: inherit; font-family: Verdana, sans-serif; font-size: 15px; margin-bottom: 1.2em; margin-top: 1.2em;&quot;&gt;Each declaration includes a CSS property name and a value, separated by a colon.&lt;/p&gt;&lt;p style=&quot;background-color: white; box-sizing: inherit; font-family: Verdana, sans-serif; font-size: 15px; margin-bottom: 1.2em; margin-top: 1.2em;&quot;&gt;A CSS declaration always ends with a semicolon, and declaration blocks are surrounded by curly braces.&lt;/p&gt;&lt;div class=&quot;w3-example&quot; style=&quot;background-color: #f1f1f1; box-shadow: none; box-sizing: inherit; font-family: Verdana, sans-serif; font-size: 15px; margin: 24px -20px; padding: 8px 20px;&quot;&gt;&lt;h3 style=&quot;box-sizing: inherit; font-family: &amp;quot;Segoe UI&amp;quot;, Arial, sans-serif; font-size: 24px; font-weight: 400; margin: 10px 0px;&quot;&gt;Example&lt;/h3&gt;&lt;p style=&quot;box-sizing: inherit; margin-bottom: 1em; margin-top: 1em;&quot;&gt;In this example all &amp;lt;p&amp;gt; elements will be center-aligned, with a red text color:&lt;/p&gt;&lt;div class=&quot;w3-code notranslate cssHigh&quot; style=&quot;background-color: white; border-left: 4px solid rgb(76, 175, 80); box-sizing: inherit; font-family: Consolas, &amp;quot;courier new&amp;quot;; margin-bottom: 16px; margin-top: 16px; overflow-wrap: break-word; padding: 8px 12px; width: auto;&quot;&gt;&lt;span class=&quot;cssselectorcolor&quot; style=&quot;box-sizing: inherit; color: brown;&quot;&gt;p&amp;nbsp;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;csspropertycolor&quot; style=&quot;box-sizing: inherit; color: red;&quot;&gt;&lt;br style=&quot;box-sizing: inherit;&quot; /&gt;color&lt;span class=&quot;csspropertyvaluecolor&quot; style=&quot;box-sizing: inherit; color: mediumblue;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;:&lt;/span&gt;&amp;nbsp;red&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;box-sizing: inherit;&quot; /&gt;text-align&lt;span class=&quot;csspropertyvaluecolor&quot; style=&quot;box-sizing: inherit; color: mediumblue;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;:&lt;/span&gt;&amp;nbsp;center&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;box-sizing: inherit;&quot; /&gt;&lt;/span&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;h4 style=&quot;background-color: white; box-sizing: inherit; font-family: &amp;quot;Segoe UI&amp;quot;, Arial, sans-serif; font-size: 20px; font-weight: 400; margin: 10px 0px;&quot;&gt;Example Explained&lt;/h4&gt;&lt;ul style=&quot;background-color: white; box-sizing: inherit; font-family: Verdana, sans-serif; font-size: 15px;&quot;&gt;&lt;li style=&quot;box-sizing: inherit;&quot;&gt;&lt;code class=&quot;w3-codespan&quot; style=&quot;background-color: #f1f1f1; box-sizing: inherit; color: crimson; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15.75px; padding-left: 4px; padding-right: 4px;&quot;&gt;p&lt;/code&gt;&amp;nbsp;is a&amp;nbsp;&lt;span style=&quot;box-sizing: inherit; font-weight: bolder;&quot;&gt;selector&lt;/span&gt;&amp;nbsp;in CSS (it points to the HTML element you want to style: &amp;lt;p&amp;gt;).&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit;&quot;&gt;&lt;code class=&quot;w3-codespan&quot; style=&quot;background-color: #f1f1f1; box-sizing: inherit; color: crimson; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15.75px; padding-left: 4px; padding-right: 4px;&quot;&gt;color&lt;/code&gt;&amp;nbsp;is a property, and&amp;nbsp;&amp;nbsp;&lt;code class=&quot;w3-codespan&quot; style=&quot;background-color: #f1f1f1; box-sizing: inherit; color: crimson; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15.75px; padding-left: 4px; padding-right: 4px;&quot;&gt;red&lt;/code&gt;&amp;nbsp;is the property value&lt;/li&gt;&lt;li style=&quot;box-sizing: inherit;&quot;&gt;&lt;code class=&quot;w3-codespan&quot; style=&quot;background-color: #f1f1f1; box-sizing: inherit; color: crimson; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15.75px; padding-left: 4px; padding-right: 4px;&quot;&gt;text-align&lt;/code&gt;&amp;nbsp;is a property, and&amp;nbsp;&amp;nbsp;&lt;code class=&quot;w3-codespan&quot; style=&quot;background-color: #f1f1f1; box-sizing: inherit; color: crimson; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15.75px; padding-left: 4px; padding-right: 4px;&quot;&gt;center&lt;/code&gt;&amp;nbsp;is the property value&lt;/li&gt;&lt;/ul&gt;

&lt;h1&gt;Inclusion&lt;/h1&gt;&lt;div&gt;&lt;span face=&quot;sans-serif&quot; style=&quot;color: blue;&quot;&gt;There are four ways to associate styles with your HTML document. Most commonly used methods are inline CSS and External CSS. Embedded CSS - The&lt;/span&gt;&lt;h1 style=&quot;color: maroon; font-family: sans-serif; margin-left: 40px;&quot;&gt;This is a heading&lt;/h1&gt;&lt;p style=&quot;color: red; font-family: sans-serif; text-align: center;&quot;&gt;This is a paragraph.&lt;/p&gt;&lt;span face=&quot;sans-serif&quot; style=&quot;color: blue;&quot;&gt;It will produce the following result − Attributes Attributes associated with&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;sans-serif&quot; style=&quot;color: blue;&quot;&gt;tags or rules defined in any external style sheet file. Any rule defined in&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;sans-serif&quot; style=&quot;color: blue;&quot;&gt;tags will override rules defined in any external style sheet file. Any rule defined in external style sheet file takes lowest priority, and rules defined in this file will be applied only when above two rules are not applicable. Handling old Browsers There are still many old browsers who do not support CSS. So, we should take care while writing our Embedded CSS in an HTML document. The following snippet shows how you can use comment tags to hide CSS from older browsers −&amp;nbsp;&lt;/span&gt;&lt;span face=&quot;sans-serif&quot; style=&quot;color: blue;&quot;&gt;CSS Comments Many times, you may need to put additional comments in your style sheet blocks. So, it is very easy to comment any part in style sheet. You can simple put your comments inside /*.....this is a comment in style sheet.....*/. You can use /* ....*/ to comment multi-line blocks in similar way you do in C and C++ programming languages. Example Live Demo&lt;/span&gt;&lt;p style=&quot;color: red; font-family: sans-serif; text-align: center;&quot;&gt;Hello World!&lt;/p&gt;&lt;span face=&quot;sans-serif&quot; style=&quot;color: blue;&quot;&gt;It will produce the following result −&lt;/span&gt;&lt;/div&gt;

&lt;h1&gt;Measurement Units&lt;/h1&gt;&lt;h1&gt;&lt;span face=&quot;sans-serif&quot; style=&quot;font-size: medium; font-weight: 400;&quot;&gt;Before we start the actual exercise, we would like to give a brief idea about the CSS Measurement Units. CSS supports a number of measurements including absolute units such as inches, centimeters, points, and so on, as well as relative measures such as percentages and em units. You need these values while specifying various measurements in your Style rules e.g. border = &quot;1px solid red&quot;. We have listed out all the CSS Measurement Units along with proper Examples − Unit Description Example % Defines a measurement as a percentage relative to another value, typically an enclosing element. p {font-size: 16pt; line-height: 125%;} cm Defines a measurement in centimeters. div {margin-bottom: 2cm;} em A relative measurement for the height of a font in em spaces. Because an em unit is equivalent to the size of a given font, if you assign a font to 12pt, each &quot;em&quot; unit would be 12pt; thus, 2em would be 24pt. p {letter-spacing: 7em;} ex This value defines a measurement relative to a font&#39;s x-height. The x-height is determined by the height of the font&#39;s lowercase letter x. p {font-size: 24pt; line-height: 3ex;} in Defines a measurement in inches. p {word-spacing: .15in;} mm Defines a measurement in millimeters. p {word-spacing: 15mm;} pc Defines a measurement in picas. A pica is equivalent to 12 points; thus, there are 6 picas per inch. p {font-size: 20pc;} pt Defines a measurement in points. A point is defined as 1/72nd of an inch. body {font-size: 18pt;} px Defines a measurement in screen pixels. p {padding: 25px;}&lt;/span&gt;&lt;/h1&gt;

&lt;h1&gt;Colors&lt;/h1&gt;
&lt;p style=&quot;margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify; color: rgb(0, 0, 0); font-size: 15px !important; font-family: Arial, Verdana, Tahoma; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;&quot;&gt;CSS uses color values to specify a color. Typically, these are used to set a color either for the foreground of an element (i.e., its text) or else for the background of the element. They can also be used to affect the color of borders and other decorative effects.&lt;/p&gt;
&lt;p style=&quot;margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify; color: rgb(0, 0, 0); font-size: 15px !important; font-family: Arial, Verdana, Tahoma; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;&quot;&gt;You can specify your color values in various formats. Following table lists all the possible formats −&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot; style=&quot;background-color: transparent; border-collapse: collapse; border-spacing: 0px; border: 1px solid rgb(221, 221, 221); width: 722.4px; max-width: 100%; margin-bottom: 20px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; text-align: center;&quot;&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th style=&quot;background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center;&quot;&gt;Format&lt;/th&gt;
      &lt;th style=&quot;background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center;&quot;&gt;Syntax&lt;/th&gt;
      &lt;th style=&quot;background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center;&quot;&gt;Example&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;Hex Code&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;#RRGGBB&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;p{color:#FF0000;}&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;Short Hex Code&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;#RGB&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;p{color:#6A7;}&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;RGB %&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;rgb(rrr%,ggg%,bbb%)&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;p{color:rgb(50%,50%,50%);}&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;RGB Absolute&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;rgb(rrr,ggg,bbb)&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;p{color:rgb(0,0,255);}&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;keyword&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;aqua, black, etc.&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;p{color:teal;}&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;p style=&quot;margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify; color: rgb(0, 0, 0); font-size: 15px !important; font-family: Arial, Verdana, Tahoma; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;&quot;&gt;These formats are explained in more detail in the following sections −&lt;/p&gt;
&lt;h2 style=&quot;margin-top: 1.25rem; margin-bottom: 0.625rem; font-weight: 400; font-size: 23px; line-height: 2rem; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;&quot;&gt;CSS Colors - Hex Codes&lt;/h2&gt;
&lt;p style=&quot;margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify; color: rgb(0, 0, 0); font-size: 15px !important; font-family: Arial, Verdana, Tahoma; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;&quot;&gt;A hexadecimal is a 6 digit representation of a color. The first two digits(RR) represent a red value, the next two are a green value(GG), and the last are the blue value(BB).&lt;/p&gt;
&lt;p style=&quot;margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify; color: rgb(0, 0, 0); font-size: 15px !important; font-family: Arial, Verdana, Tahoma; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;&quot;&gt;A hexadecimal value can be taken from any graphics software like Adobe Photoshop, Jasc Paintshop Pro, or even using Advanced Paint Brush.&lt;/p&gt;
&lt;p style=&quot;margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify; color: rgb(0, 0, 0); font-size: 15px !important; font-family: Arial, Verdana, Tahoma; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;&quot;&gt;Each hexadecimal code will be preceded by a pound or hash sign &#39;#&#39;. Following are the examples to use Hexadecimal notation.&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot; style=&quot;background-color: transparent; border-collapse: collapse; border-spacing: 0px; border: 1px solid rgb(221, 221, 221); width: 722.4px; max-width: 100%; margin-bottom: 20px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;&quot;&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th style=&quot;background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center; width: 344.8px;&quot;&gt;Color&lt;/th&gt;
      &lt;th style=&quot;background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center; width: 344px;&quot;&gt;Color HEX&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#000000&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center;&quot;&gt;#000000&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#ff0000&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center;&quot;&gt;#FF0000&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#00ff00&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center;&quot;&gt;#00FF00&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#0000ff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center;&quot;&gt;#0000FF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#ffff00&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center;&quot;&gt;#FFFF00&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#00ffff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center;&quot;&gt;#00FFFF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#ff00ff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center;&quot;&gt;#FF00FF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#c0c0c0&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center;&quot;&gt;#C0C0C0&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#ffffff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center;&quot;&gt;#FFFFFF&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 style=&quot;margin-top: 1.25rem; margin-bottom: 0.625rem; font-weight: 400; font-size: 23px; line-height: 2rem; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;&quot;&gt;CSS Colors - Short Hex Codes&lt;/h2&gt;
&lt;p style=&quot;margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify; color: rgb(0, 0, 0); font-size: 15px !important; font-family: Arial, Verdana, Tahoma; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;&quot;&gt;This is a shorter form of the six-digit notation. In this format, each digit is replicated to arrive at an equivalent six-digit value. For example: #6A7 becomes #66AA77.&lt;/p&gt;
&lt;p style=&quot;margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify; color: rgb(0, 0, 0); font-size: 15px !important; font-family: Arial, Verdana, Tahoma; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;&quot;&gt;A hexadecimal value can be taken from any graphics software like Adobe Photoshop, Jasc Paintshop Pro, or even using Advanced Paint Brush.&lt;/p&gt;
&lt;p style=&quot;margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify; color: rgb(0, 0, 0); font-size: 15px !important; font-family: Arial, Verdana, Tahoma; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;&quot;&gt;Each hexadecimal code will be preceded by a pound or hash sign &#39;#&#39;. Following are the examples to use Hexadecimal notation.&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot; style=&quot;background-color: transparent; border-collapse: collapse; border-spacing: 0px; border: 1px solid rgb(221, 221, 221); width: 722.4px; max-width: 100%; margin-bottom: 20px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;&quot;&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th style=&quot;background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center; width: 344.8px;&quot;&gt;Color&lt;/th&gt;
      &lt;th style=&quot;background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center; width: 344px;&quot;&gt;Color HEX&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#000&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center;&quot;&gt;#000&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#F00&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center;&quot;&gt;#F00&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#0F0&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center;&quot;&gt;#0F0&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#00F&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center;&quot;&gt;#0FF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#FF0&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center;&quot;&gt;#FF0&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#0FF&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center;&quot;&gt;#0FF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#F0F&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center;&quot;&gt;#F0F&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#FFF&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center;&quot;&gt;#FFF&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 style=&quot;margin-top: 1.25rem; margin-bottom: 0.625rem; font-weight: 400; font-size: 23px; line-height: 2rem; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;&quot;&gt;CSS Colors - RGB Values&lt;/h2&gt;
&lt;p style=&quot;margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify; color: rgb(0, 0, 0); font-size: 15px !important; font-family: Arial, Verdana, Tahoma; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;&quot;&gt;This color value is specified using the&amp;nbsp;
  &lt;b style=&quot;font-weight: 640;&quot;&gt;rgb( )&lt;/b&gt; property. This property takes three values, one each for red, green, and blue. The value can be an integer between 0 and 255 or a percentage.
&lt;/p&gt;
&lt;p style=&quot;margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify; color: rgb(0, 0, 0); font-size: 15px !important; font-family: Arial, Verdana, Tahoma; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;&quot;&gt;
  &lt;b style=&quot;font-weight: 640;&quot;&gt;NOTE&lt;/b&gt; − All the browsers does not support rgb() property of color so it is recommended not to use it.
&lt;/p&gt;
&lt;p style=&quot;margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify; color: rgb(0, 0, 0); font-size: 15px !important; font-family: Arial, Verdana, Tahoma; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;&quot;&gt;Following is the example to show few colors using RGB values.&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot; style=&quot;background-color: transparent; border-collapse: collapse; border-spacing: 0px; border: 1px solid rgb(221, 221, 221); width: 722.4px; max-width: 100%; margin-bottom: 20px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;&quot;&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th style=&quot;background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center; width: 344.8px;&quot;&gt;Color&lt;/th&gt;
      &lt;th style=&quot;background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center; width: 344px;&quot;&gt;Color RGB&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#000000&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center;&quot;&gt;rgb(0,0,0)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#ff0000&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center;&quot;&gt;rgb(255,0,0)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#00ff00&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center;&quot;&gt;rgb(0,255,0)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#0000ff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center;&quot;&gt;rgb(0,0,255)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#ffff00&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center;&quot;&gt;rgb(255,255,0)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#00ffff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center;&quot;&gt;rgb(0,255,255)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#ff00ff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center;&quot;&gt;rgb(255,0,255)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#c0c0c0&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center;&quot;&gt;rgb(192,192,192)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#ffffff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; text-align: center;&quot;&gt;rgb(255,255,255)&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 style=&quot;margin-top: 1.25rem; margin-bottom: 0.625rem; font-weight: 400; font-size: 23px; line-height: 2rem; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;&quot;&gt;Building Color Codes&lt;/h2&gt;
&lt;p style=&quot;margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify; color: rgb(0, 0, 0); font-size: 15px !important; font-family: Arial, Verdana, Tahoma; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;&quot;&gt;You can build millions of color codes using our Color Code Builder. Check our&amp;nbsp;
  &lt;b style=&quot;font-weight: 640;&quot;&gt;HTML Color Code Builder&lt;/b&gt;. To use this tool, you would need a Java Enabled Browser.
&lt;/p&gt;
&lt;h2 style=&quot;margin-top: 1.25rem; margin-bottom: 0.625rem; font-weight: 400; font-size: 23px; line-height: 2rem; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;&quot;&gt;Browser Safe Colors&lt;/h2&gt;
&lt;p style=&quot;margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify; color: rgb(0, 0, 0); font-size: 15px !important; font-family: Arial, Verdana, Tahoma; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;&quot;&gt;Here is the list of 216 colors which are supposed to be most safe and computer independent colors. These colors vary from hexa code 000000 to FFFFFF. These colors are safe to use because they ensure that all computers would display the colors correctly when running a 256 color palette −&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot; style=&quot;background-color: transparent; border-collapse: collapse; border-spacing: 0px; border: 1px solid rgb(221, 221, 221); width: 722.4px; max-width: 100%; margin-bottom: 20px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#000000&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;000000&lt;/td&gt;
      &lt;td bgcolor=&quot;#000033&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;000033&lt;/td&gt;
      &lt;td bgcolor=&quot;#000066&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;000066&lt;/td&gt;
      &lt;td bgcolor=&quot;#000099&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;000099&lt;/td&gt;
      &lt;td bgcolor=&quot;#0000cc&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;0000CC&lt;/td&gt;
      &lt;td bgcolor=&quot;#0000ff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;0000FF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#003300&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;003300&lt;/td&gt;
      &lt;td bgcolor=&quot;#003333&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;003333&lt;/td&gt;
      &lt;td bgcolor=&quot;#003366&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;003366&lt;/td&gt;
      &lt;td bgcolor=&quot;#003399&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;003399&lt;/td&gt;
      &lt;td bgcolor=&quot;#0033cc&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;0033CC&lt;/td&gt;
      &lt;td bgcolor=&quot;#0033ff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;0033FF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#006600&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;006600&lt;/td&gt;
      &lt;td bgcolor=&quot;#006633&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;006633&lt;/td&gt;
      &lt;td bgcolor=&quot;#006666&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;006666&lt;/td&gt;
      &lt;td bgcolor=&quot;#006699&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;006699&lt;/td&gt;
      &lt;td bgcolor=&quot;#0066cc&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;0066CC&lt;/td&gt;
      &lt;td bgcolor=&quot;#0066ff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;0066FF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#009900&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;009900&lt;/td&gt;
      &lt;td bgcolor=&quot;#009933&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;009933&lt;/td&gt;
      &lt;td bgcolor=&quot;#009966&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;009966&lt;/td&gt;
      &lt;td bgcolor=&quot;#009999&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;009999&lt;/td&gt;
      &lt;td bgcolor=&quot;#0099cc&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;0099CC&lt;/td&gt;
      &lt;td bgcolor=&quot;#0099ff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;0099FF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#00cc00&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;00CC00&lt;/td&gt;
      &lt;td bgcolor=&quot;#00cc33&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;00CC33&lt;/td&gt;
      &lt;td bgcolor=&quot;#00cc66&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;00CC66&lt;/td&gt;
      &lt;td bgcolor=&quot;#00cc99&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;00CC99&lt;/td&gt;
      &lt;td bgcolor=&quot;#00cccc&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;00CCCC&lt;/td&gt;
      &lt;td bgcolor=&quot;#00ccff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;00CCFF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#00ff00&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;00FF00&lt;/td&gt;
      &lt;td bgcolor=&quot;#00ff33&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;00FF33&lt;/td&gt;
      &lt;td bgcolor=&quot;#00ff66&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;00FF66&lt;/td&gt;
      &lt;td bgcolor=&quot;#00ff99&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;00FF99&lt;/td&gt;
      &lt;td bgcolor=&quot;#00ffcc&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;00FFCC&lt;/td&gt;
      &lt;td bgcolor=&quot;#00ffff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;00FFFF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#330000&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;330000&lt;/td&gt;
      &lt;td bgcolor=&quot;#330033&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;330033&lt;/td&gt;
      &lt;td bgcolor=&quot;#330066&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;330066&lt;/td&gt;
      &lt;td bgcolor=&quot;#330099&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;330099&lt;/td&gt;
      &lt;td bgcolor=&quot;#3300cc&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;3300CC&lt;/td&gt;
      &lt;td bgcolor=&quot;#3300ff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;3300FF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#333300&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;333300&lt;/td&gt;
      &lt;td bgcolor=&quot;#333333&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;333333&lt;/td&gt;
      &lt;td bgcolor=&quot;#333366&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;333366&lt;/td&gt;
      &lt;td bgcolor=&quot;#333399&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;333399&lt;/td&gt;
      &lt;td bgcolor=&quot;#3333cc&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;3333CC&lt;/td&gt;
      &lt;td bgcolor=&quot;#3333ff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;3333FF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#336600&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;336600&lt;/td&gt;
      &lt;td bgcolor=&quot;#336633&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;336633&lt;/td&gt;
      &lt;td bgcolor=&quot;#336666&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;336666&lt;/td&gt;
      &lt;td bgcolor=&quot;#336699&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;336699&lt;/td&gt;
      &lt;td bgcolor=&quot;#3366cc&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;3366CC&lt;/td&gt;
      &lt;td bgcolor=&quot;#3366ff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;3366FF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#339900&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;339900&lt;/td&gt;
      &lt;td bgcolor=&quot;#339933&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;339933&lt;/td&gt;
      &lt;td bgcolor=&quot;#339966&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;339966&lt;/td&gt;
      &lt;td bgcolor=&quot;#339999&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;339999&lt;/td&gt;
      &lt;td bgcolor=&quot;#3399cc&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;3399CC&lt;/td&gt;
      &lt;td bgcolor=&quot;#3399ff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;3399FF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#33cc00&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;33CC00&lt;/td&gt;
      &lt;td bgcolor=&quot;#33cc33&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;33CC33&lt;/td&gt;
      &lt;td bgcolor=&quot;#33cc66&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;33CC66&lt;/td&gt;
      &lt;td bgcolor=&quot;#33cc99&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;33CC99&lt;/td&gt;
      &lt;td bgcolor=&quot;#33cccc&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;33CCCC&lt;/td&gt;
      &lt;td bgcolor=&quot;#33ccff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;33CCFF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#33ff00&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;33FF00&lt;/td&gt;
      &lt;td bgcolor=&quot;#33ff33&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;33FF33&lt;/td&gt;
      &lt;td bgcolor=&quot;#33ff66&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;33FF66&lt;/td&gt;
      &lt;td bgcolor=&quot;#33ff99&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;33FF99&lt;/td&gt;
      &lt;td bgcolor=&quot;#33ffcc&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;33FFCC&lt;/td&gt;
      &lt;td bgcolor=&quot;#33ffff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;33FFFF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#660000&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;660000&lt;/td&gt;
      &lt;td bgcolor=&quot;#660033&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;660033&lt;/td&gt;
      &lt;td bgcolor=&quot;#660066&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;660066&lt;/td&gt;
      &lt;td bgcolor=&quot;#660099&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;660099&lt;/td&gt;
      &lt;td bgcolor=&quot;#6600cc&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;6600CC&lt;/td&gt;
      &lt;td bgcolor=&quot;#6600ff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;6600FF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#663300&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;663300&lt;/td&gt;
      &lt;td bgcolor=&quot;#663333&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;663333&lt;/td&gt;
      &lt;td bgcolor=&quot;#663366&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;663366&lt;/td&gt;
      &lt;td bgcolor=&quot;#663399&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;663399&lt;/td&gt;
      &lt;td bgcolor=&quot;#6633cc&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;6633CC&lt;/td&gt;
      &lt;td bgcolor=&quot;#6633ff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;6633FF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#666600&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;666600&lt;/td&gt;
      &lt;td bgcolor=&quot;#666633&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;666633&lt;/td&gt;
      &lt;td bgcolor=&quot;#666666&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;666666&lt;/td&gt;
      &lt;td bgcolor=&quot;#666699&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;666699&lt;/td&gt;
      &lt;td bgcolor=&quot;#6666cc&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;6666CC&lt;/td&gt;
      &lt;td bgcolor=&quot;#6666ff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;6666FF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#669900&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;669900&lt;/td&gt;
      &lt;td bgcolor=&quot;#669933&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;669933&lt;/td&gt;
      &lt;td bgcolor=&quot;#669966&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;669966&lt;/td&gt;
      &lt;td bgcolor=&quot;#669999&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;669999&lt;/td&gt;
      &lt;td bgcolor=&quot;#6699cc&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;6699CC&lt;/td&gt;
      &lt;td bgcolor=&quot;#6699ff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;6699FF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#66cc00&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;66CC00&lt;/td&gt;
      &lt;td bgcolor=&quot;#66cc33&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;66CC33&lt;/td&gt;
      &lt;td bgcolor=&quot;#66cc66&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;66CC66&lt;/td&gt;
      &lt;td bgcolor=&quot;#66cc99&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;66CC99&lt;/td&gt;
      &lt;td bgcolor=&quot;#66cccc&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;66CCCC&lt;/td&gt;
      &lt;td bgcolor=&quot;#66ccff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;66CCFF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#66ff00&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;66FF00&lt;/td&gt;
      &lt;td bgcolor=&quot;#66ff33&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;66FF33&lt;/td&gt;
      &lt;td bgcolor=&quot;#66ff66&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;66FF66&lt;/td&gt;
      &lt;td bgcolor=&quot;#66ff99&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;66FF99&lt;/td&gt;
      &lt;td bgcolor=&quot;#66ffcc&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;66FFCC&lt;/td&gt;
      &lt;td bgcolor=&quot;#66ffff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;66FFFF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#990000&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;990000&lt;/td&gt;
      &lt;td bgcolor=&quot;#990033&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;990033&lt;/td&gt;
      &lt;td bgcolor=&quot;#990066&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;990066&lt;/td&gt;
      &lt;td bgcolor=&quot;#990099&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;990099&lt;/td&gt;
      &lt;td bgcolor=&quot;#9900cc&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;9900CC&lt;/td&gt;
      &lt;td bgcolor=&quot;#9900ff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;9900FF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#993300&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;993300&lt;/td&gt;
      &lt;td bgcolor=&quot;#993333&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;993333&lt;/td&gt;
      &lt;td bgcolor=&quot;#993366&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;993366&lt;/td&gt;
      &lt;td bgcolor=&quot;#993399&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;993399&lt;/td&gt;
      &lt;td bgcolor=&quot;#9933cc&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;9933CC&lt;/td&gt;
      &lt;td bgcolor=&quot;#9933ff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;9933FF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#996600&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;996600&lt;/td&gt;
      &lt;td bgcolor=&quot;#996633&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;996633&lt;/td&gt;
      &lt;td bgcolor=&quot;#996666&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;996666&lt;/td&gt;
      &lt;td bgcolor=&quot;#996699&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;996699&lt;/td&gt;
      &lt;td bgcolor=&quot;#9966cc&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;9966CC&lt;/td&gt;
      &lt;td bgcolor=&quot;#9966ff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;9966FF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#999900&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;999900&lt;/td&gt;
      &lt;td bgcolor=&quot;#999933&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;999933&lt;/td&gt;
      &lt;td bgcolor=&quot;#999966&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;999966&lt;/td&gt;
      &lt;td bgcolor=&quot;#999999&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;999999&lt;/td&gt;
      &lt;td bgcolor=&quot;#9999cc&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;9999CC&lt;/td&gt;
      &lt;td bgcolor=&quot;#9999ff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;9999FF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#99cc00&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;99CC00&lt;/td&gt;
      &lt;td bgcolor=&quot;#99cc33&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;99CC33&lt;/td&gt;
      &lt;td bgcolor=&quot;#99cc66&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;99CC66&lt;/td&gt;
      &lt;td bgcolor=&quot;#99cc99&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;99CC99&lt;/td&gt;
      &lt;td bgcolor=&quot;#99cccc&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;99CCCC&lt;/td&gt;
      &lt;td bgcolor=&quot;#99ccff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;99CCFF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#99ff00&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;99FF00&lt;/td&gt;
      &lt;td bgcolor=&quot;#99ff33&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;99FF33&lt;/td&gt;
      &lt;td bgcolor=&quot;#99ff66&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;99FF66&lt;/td&gt;
      &lt;td bgcolor=&quot;#99ff99&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;99FF99&lt;/td&gt;
      &lt;td bgcolor=&quot;#99ffcc&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;99FFCC&lt;/td&gt;
      &lt;td bgcolor=&quot;#99ffff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top;&quot;&gt;99FFFF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#cc0000&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;CC0000&lt;/td&gt;
      &lt;td bgcolor=&quot;#cc0033&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;CC0033&lt;/td&gt;
      &lt;td bgcolor=&quot;#cc0066&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;CC0066&lt;/td&gt;
      &lt;td bgcolor=&quot;#cc0099&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;CC0099&lt;/td&gt;
      &lt;td bgcolor=&quot;#cc00cc&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;CC00CC&lt;/td&gt;
      &lt;td bgcolor=&quot;#cc00ff&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;CC00FF&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td bgcolor=&quot;#cc3300&quot; style=&quot;border: 1px solid rgb(221, 221, 221); padding: 8px; line-height: 1.42857; vertical-align: top; color: white;&quot;&gt;CC3300&lt;/td&gt;

&lt;h1&gt;Fonts&lt;/h1&gt;&lt;h1&gt;&lt;span face=&quot;sans-serif&quot; style=&quot;font-size: medium; font-weight: 400;&quot;&gt;This chapter teaches you how to set fonts of a content, available in an HTML element. You can set following font properties of an element − The font-family property is used to change the face of a font. The font-style property is used to make a font italic or oblique. The font-variant property is used to create a small-caps effect. The font-weight property is used to increase or decrease how bold or light a font appears. The font-size property is used to increase or decrease the size of a font. The font property is used as shorthand to specify a number of other font properties. Set the Font Family Following is the example, which demonstrates how to set the font family of an element. Possible value could be any font family name. Live Demo&lt;/span&gt;&lt;p style=&quot;font-family: georgia, garamond, serif; font-size: medium; font-weight: 400;&quot;&gt;This text is rendered in either georgia, garamond, or the default serif font depending on which font you have at your system.&lt;/p&gt;&lt;span face=&quot;sans-serif&quot; style=&quot;font-size: medium; font-weight: 400;&quot;&gt;This will produce following result − Set the Font Style Following is the example, which demonstrates how to set the font style of an element. Possible values are normal, italic and oblique. Live Demo&lt;/span&gt;&lt;p style=&quot;font-family: sans-serif; font-size: medium; font-style: italic; font-weight: 400;&quot;&gt;This text will be rendered in italic style&lt;/p&gt;&lt;span face=&quot;sans-serif&quot; style=&quot;font-size: medium; font-weight: 400;&quot;&gt;This will produce following result − Set the Font Variant The following example demonstrates how to set the font variant of an element. Possible values are normal and small-caps. Live Demo&lt;/span&gt;&lt;p style=&quot;font-family: sans-serif; font-size: medium; font-variant-caps: small-caps; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 400;&quot;&gt;This text will be rendered as small caps&lt;/p&gt;&lt;span face=&quot;sans-serif&quot; style=&quot;font-size: medium; font-weight: 400;&quot;&gt;This will produce following result − Set the Font Weight The following example demonstrates how to set the font weight of an element. The font-weight property provides the functionality to specify how bold a font is. Possible values could be normal, bold, bolder, lighter, 100, 200, 300, 400, 500, 600, 700, 800, 900. Live Demo&lt;/span&gt;&lt;p style=&quot;font-family: sans-serif; font-size: medium;&quot;&gt;This font is bold.&lt;/p&gt;&lt;p style=&quot;font-family: sans-serif; font-size: medium; font-weight: bolder;&quot;&gt;This font is bolder.&lt;/p&gt;&lt;p style=&quot;font-family: sans-serif; font-size: medium; font-weight: 500;&quot;&gt;This font is 500 weight.&lt;/p&gt;&lt;span face=&quot;sans-serif&quot; style=&quot;font-size: medium; font-weight: 400;&quot;&gt;This will produce following result − Set the Font Size The following example demonstrates how to set the font size of an element. The font-size property is used to control the size of fonts. Possible values could be xx-small, x-small, small, medium, large, x-large, xx-large, smaller, larger, size in pixels or in %. Live Demo&lt;/span&gt;&lt;p style=&quot;font-family: sans-serif; font-size: 20px; font-weight: 400;&quot;&gt;This font size is 20 pixels&lt;/p&gt;&lt;p style=&quot;font-family: sans-serif; font-size: small; font-weight: 400;&quot;&gt;This font size is small&lt;/p&gt;&lt;p style=&quot;font-family: sans-serif; font-size: large; font-weight: 400;&quot;&gt;This font size is large&lt;/p&gt;&lt;span face=&quot;sans-serif&quot; style=&quot;font-size: medium; font-weight: 400;&quot;&gt;This will produce following result − Set the Font Size Adjust The following example demonstrates how to set the font size adjust of an element. This property enables you to adjust the x-height to make fonts more legible. Possible value could be any number. Live Demo&lt;/span&gt;&lt;p style=&quot;font-family: sans-serif; font-size: medium; font-weight: 400;&quot;&gt;This text is using a font-size-adjust value.&lt;/p&gt;&lt;span face=&quot;sans-serif&quot; style=&quot;font-size: medium; font-weight: 400;&quot;&gt;This will produce following result − Set the Font Stretch The following example demonstrates how to set the font stretch of an element. This property relies on the user&#39;s computer to have an expanded or condensed version of the font being used. Possible values could be normal, wider, narrower, ultra-condensed, extra-condensed, condensed, semi-condensed, semi-expanded, expanded, extra-expanded, ultra-expanded. Live Demo&lt;/span&gt;&lt;p style=&quot;font-family: sans-serif; font-size: medium; font-stretch: ultra-expanded; font-weight: 400;&quot;&gt;If this doesn&#39;t appear to work, it is likely that your computer doesn&#39;t have a&lt;br /&gt;condensed or expanded version of the font being used.&lt;/p&gt;&lt;span face=&quot;sans-serif&quot; style=&quot;font-size: medium; font-weight: 400;&quot;&gt;This will produce following result − Shorthand Property You can use the font property to set all the font properties at once. For example − Live Demo&lt;/span&gt;&lt;p style=&quot;font-family: georgia; font-size: 15px; font-stretch: normal; font-style: italic; font-variant-caps: small-caps; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;&quot;&gt;Applying all the properties on the text at once.&lt;/p&gt;&lt;span face=&quot;sans-serif&quot; style=&quot;font-size: medium; font-weight: 400;&quot;&gt;This will produce following result −&lt;/span&gt;&lt;/h1&gt;

&lt;h1&gt;Text&lt;/h1&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span face=&quot;sans-serif&quot;&gt;This chapter teaches you how to manipulate text using CSS properties. You can set following text properties of an element − The color property is used to set the color of a text. The direction property is used to set the text direction. The letter-spacing property is used to add or subtract space between the letters that make up a word. The word-spacing property is used to add or subtract space between the words of a sentence. The text-indent property is used to indent the text of a paragraph. The text-align property is used to align the text of a document. The text-decoration property is used to underline, overline, and strikethrough text. The text-transform property is used to capitalize text or convert text to uppercase or lowercase letters. The white-space property is used to control the flow and formatting of text. The text-shadow property is used to set the text shadow around a text. Set the Text Color The following example demonstrates how to set the text color. Possible value could be any color name in any valid format. Live Demo&lt;/span&gt;&lt;p style=&quot;color: red; font-family: sans-serif;&quot;&gt;This text will be written in red.&lt;/p&gt;&lt;span face=&quot;sans-serif&quot;&gt;It will produce the following result − Set the Text Direction The following example demonstrates how to set the direction of a text. Possible values are ltr or rtl. Live Demo&lt;/span&gt;&lt;p style=&quot;direction: rtl; font-family: sans-serif; text-align: start;&quot;&gt;This text will be rendered from right to left&lt;/p&gt;&lt;span face=&quot;sans-serif&quot;&gt;It will produce the following result − Set the Space between Characters The following example demonstrates how to set the space between characters. Possible values are normal or a number specifying space.. Live Demo&lt;/span&gt;&lt;p style=&quot;font-family: sans-serif; letter-spacing: 5px;&quot;&gt;This text is having space between letters.&lt;/p&gt;&lt;span face=&quot;sans-serif&quot;&gt;It will produce the following result − Set the Space between Words The following example demonstrates how to set the space between words. Possible values are normal or a number specifying space. Live Demo&lt;/span&gt;&lt;p style=&quot;font-family: sans-serif; word-spacing: 5px;&quot;&gt;This text is having space between words.&lt;/p&gt;&lt;span face=&quot;sans-serif&quot;&gt;This will produce following result − Set the Text Indent The following example demonstrates how to indent the first line of a paragraph. Possible values are % or a number specifying indent space. Live Demo&lt;/span&gt;&lt;p style=&quot;font-family: sans-serif; text-indent: 1cm;&quot;&gt;This text will have first line indented by 1cm and this line will remain at its actual position this is done by CSS text-indent property.&lt;/p&gt;&lt;span face=&quot;sans-serif&quot;&gt;It will produce the following result − Set the Text Alignment The following example demonstrates how to align a text. Possible values are left, right, center, justify. Live Demo&lt;/span&gt;&lt;p style=&quot;font-family: sans-serif; text-align: right;&quot;&gt;This will be right aligned.&lt;/p&gt;&lt;p style=&quot;font-family: sans-serif; text-align: center;&quot;&gt;This will be center aligned.&lt;/p&gt;&lt;p style=&quot;font-family: sans-serif;&quot;&gt;This will be left aligned.&lt;/p&gt;&lt;span face=&quot;sans-serif&quot;&gt;This will produce following result − Decorating the Text The following example demonstrates how to decorate a text. Possible values are none, underline, overline, line-through, blink. Live Demo&lt;/span&gt;&lt;p style=&quot;font-family: sans-serif; text-decoration-line: underline;&quot;&gt;This will be underlined&lt;/p&gt;&lt;p style=&quot;font-family: sans-serif; text-decoration-line: line-through;&quot;&gt;This will be striked through.&lt;/p&gt;&lt;p style=&quot;font-family: sans-serif; text-decoration-line: overline;&quot;&gt;This will have a over line.&lt;/p&gt;&lt;p style=&quot;font-family: sans-serif; text-decoration-line: blink;&quot;&gt;This text will have blinking effect&lt;/p&gt;&lt;span face=&quot;sans-serif&quot;&gt;This will produce following result − Set the Text Cases The following example demonstrates how to set the cases for a text. Possible values are none, capitalize, uppercase, lowercase. Live Demo&lt;/span&gt;&lt;p style=&quot;font-family: sans-serif; text-transform: capitalize;&quot;&gt;This Will Be Capitalized&lt;/p&gt;&lt;p style=&quot;font-family: sans-serif; text-transform: uppercase;&quot;&gt;THIS WILL BE IN UPPERCASE&lt;/p&gt;&lt;p style=&quot;font-family: sans-serif; text-transform: lowercase;&quot;&gt;this will be in lowercase&lt;/p&gt;&lt;span face=&quot;sans-serif&quot;&gt;This will produce following result − Set the White Space between Text The following example demonstrates how white space inside an element is handled. Possible values are normal, pre, nowrap. Live Demo&lt;/span&gt;&lt;p style=&quot;font-family: sans-serif; white-space: pre;&quot;&gt;
         This text has a line break and the white-space pre setting 
         tells the browser to honor it just like the HTML pre tag.
      &lt;/p&gt;&lt;span face=&quot;sans-serif&quot;&gt;This will produce following result − Set the Text Shadow The following example demonstrates how to set the shadow around a text. This may not be supported by all the browsers. Live Demo&lt;/span&gt;&lt;p style=&quot;font-family: sans-serif; text-shadow: blue 4px 4px 8px;&quot;&gt;If your browser supports the CSS text-shadow property, this text will have a blue shadow.&lt;/p&gt;&lt;span face=&quot;sans-serif&quot;&gt;It will produce the following result −&lt;/span&gt;&lt;/div&gt;

&lt;h1&gt;Images&lt;/h1&gt;
Images play an important role in any webpage. Though it is not recommended to include a lot of images, but it is still important to use good images wherever required.

CSS plays a good role to control image display. You can set the following image properties using CSS.

The border property is used to set the width of an image border.

The height property is used to set the height of an image.

The width property is used to set the width of an image.

The -moz-opacity property is used to set the opacity of an image.

The Image Border Property
The border property of an image is used to set the width of an image border. This property can have a value in length or in %.

A width of zero pixels means no border.

Here is the example −

Live Demo
&lt;html&gt;
   &lt;head&gt;
   &lt;/head&gt;

   &lt;body&gt;
      &lt;img src=&quot;/css/images/logo.png&quot; style=&quot;border: 0px;&quot; /&gt;
      &lt;br /&gt;
      &lt;img src=&quot;/css/images/logo.png&quot; style=&quot;border: 3px dashed red;&quot; /&gt;
   &lt;/body&gt;
&lt;/html&gt; 
It will produce the following result −


The Image Height Property
The height property of an image is used to set the height of an image. This property can have a value in length or in %. While giving value in %, it applies it in respect of the box in which an image is available.

Here is an example −

Live Demo
&lt;html&gt;
   &lt;head&gt;
   &lt;/head&gt;

   &lt;body&gt;
      &lt;img src=&quot;/css/images/logo.png&quot; style=&quot;border: 1px solid red; height: 100px;&quot; /&gt;
      &lt;br /&gt;
      &lt;img src=&quot;/css/images/logo.png&quot; style=&quot;border: 1px solid red; height: 50%;&quot; /&gt;
   &lt;/body&gt;
&lt;/html&gt; 
It will produce the following result −


The Image Width Property
The width property of an image is used to set the width of an image. This property can have a value in length or in %. While giving value in %, it applies it in respect of the box in which an image is available.

Here is an example −

Live Demo
&lt;html&gt;
   &lt;head&gt;
   &lt;/head&gt;

   &lt;body&gt;
      &lt;img src=&quot;/css/images/logo.png&quot; style=&quot;border: 1px solid red; width: 150px;&quot; /&gt;
      &lt;br /&gt;
      &lt;img src=&quot;/css/images/logo.png&quot; style=&quot;border: 1px solid red; width: 100%;&quot; /&gt;
   &lt;/body&gt;
&lt;/html&gt; 
It will produce the following result −


The -moz-opacity Property
The -moz-opacity property of an image is used to set the opacity of an image. This property is used to create a transparent image in Mozilla. IE uses filter:alpha(opacity=x) to create transparent images.

In Mozilla (-moz-opacity:x) x can be a value from 0.0 - 1.0. A lower value makes the element more transparent (The same things goes for the CSS3-valid syntax opacity:x).

In IE (filter:alpha(opacity=x)) x can be a value from 0 - 100. A lower value makes the element more transparent.

Here is an example −

Live Demo
&lt;html&gt;
   &lt;head&gt;
   &lt;/head&gt;

   &lt;body&gt;
      &lt;img src=&quot;/css/images/logo.png&quot; style=&quot;-moz-opacity: 0.4; border: 1px solid red; filter: alpha(opacity=40);&quot; /&gt;
   &lt;/body&gt;
&lt;/html&gt; 
It will produce the following result −

&lt;h1&gt;Links&lt;/h1&gt;
This chapter teaches you how to set different properties of a hyper link using CSS. You can set following properties of a hyper link −

We will revisit the same properties when we will discuss Pseudo-Classes of CSS.

The :link signifies unvisited hyperlinks.

The :visited signifies visited hyperlinks.

The :hover signifies an element that currently has the user&#39;s mouse pointer hovering over it.

The :active signifies an element on which the user is currently clicking.

Usually, all these properties are kept in the header part of the HTML document.

Remember a:hover MUST come after a:link and a:visited in the CSS definition in order to be effective. Also, a:active MUST come after a:hover in the CSS definition as follows −

&lt;style type=&quot;text/css&quot;&gt;
   a:link {color: #000000}
   a:visited {color: #006600}
   a:hover {color: #FFCC00}
   a:active {color: #FF00CC}
&lt;/style&gt;
Now, we will see how to use these properties to give different effects to hyperlinks.

Set the Color of Links
The following example demonstrates how to set the link color. Possible values could be any color name in any valid format.

Live Demo
&lt;html&gt;
   &lt;head&gt;
      &lt;style type=&quot;text/css&quot;&gt;
         a:link {color:#000000}
     &lt;/style&gt;
   &lt;/head&gt;

   &lt;body&gt;
      &lt;a href=&quot;&quot;&gt;Link&lt;/a&gt;
   &lt;/body&gt;
&lt;/html&gt; 
It will produce the following black link −


Set the Color of Visited Links
The following example demonstrates how to set the color of visited links. Possible values could be any color name in any valid format.

Live Demo
&lt;html&gt;
   &lt;head&gt;
      &lt;style type=&quot;text/css&quot;&gt;
         a:visited {color: #006600}
      &lt;/style&gt;
   &lt;/head&gt;

   &lt;body&gt;
      &lt;a href=&quot;&quot;&gt; link&lt;/a&gt; 
   &lt;/body&gt;
&lt;/html&gt; 
It will produce the following link. Once you will click this link, it will change its color to green.


Change the Color of Links when Mouse is Over
The following example demonstrates how to change the color of links when we bring a mouse pointer over that link. Possible values could be any color name in any valid format.

Live Demo
&lt;html&gt;
   &lt;head&gt;
      &lt;style type=&quot;text/css&quot;&gt;
         a:hover {color: #FFCC00}
      &lt;/style&gt;
   &lt;/head&gt;

   &lt;body&gt;
      &lt;a href=&quot;&quot;&gt;Link&lt;/a&gt;
   &lt;/body&gt;
&lt;/html&gt; 
It will produce the following link. Now, you bring your mouse over this link and you will see that it changes its color to yellow.


Change the Color of Active Links
The following example demonstrates how to change the color of active links. Possible values could be any color name in any valid format.

Live Demo
&lt;html&gt;
   &lt;head&gt;
      &lt;style type=&quot;text/css&quot;&gt;
         a:active {color: #FF00CC}
      &lt;/style&gt;
   &lt;/head&gt;

   &lt;body&gt;
      &lt;a href=&quot;&quot;&gt;Link&lt;/a&gt;
   &lt;/body&gt;
&lt;/html&gt; 
It will produce the following link. It will change its color to pink when the user clicks it.

&lt;h1&gt;Tables&lt;/h1&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;This tutorial will teach you how to set different properties of an HTML table using CSS. You can set following properties of a table −&lt;/p&gt;
&lt;ul class=&quot;list&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0.625rem; margin-top: 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The&amp;nbsp;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;border-collapse&lt;/b&gt; specifies whether the browser should control the appearance of the adjacent borders that touch each other or whether each cell should maintain its style.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The&amp;nbsp;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;border-spacing&lt;/b&gt; specifies the width that should appear between table cells.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The&amp;nbsp;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;caption-side&lt;/b&gt; captions are presented in the &amp;lt;caption&amp;gt; element. By default, these are rendered above the table in the document. You use the&amp;nbsp;&lt;em&gt;caption-side&lt;/em&gt; property to control the placement of the table caption.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The&amp;nbsp;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;empty-cells&lt;/b&gt; specifies whether the border should be shown if a cell is empty.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The&amp;nbsp;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;table-layout&lt;/b&gt; allows browsers to speed up layout of a table by using the first width properties it comes across for the rest of a column rather than having to load the whole table before rendering it.
    &lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Now, we will see how to use these properties with examples.&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The border-collapse Property&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;This property can have two values&amp;nbsp;&lt;em&gt;collapse&lt;/em&gt; and&amp;nbsp;&lt;em&gt;separate&lt;/em&gt;. The following example uses both the values −&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/2wJiMF&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;text/css&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; table&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;one &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;collapse&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;collapse&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; table&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;two &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;collapse&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;separate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; td&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;a &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;dotted&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;3px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:#&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;000000&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; padding&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; td&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;b &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;solid&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;3px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:#&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;333333&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; padding&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;table&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;one&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;caption&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Collapse Border Example&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/caption&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;tr&amp;gt;&amp;lt;td&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;a&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; Cell A Collapse Example&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;tr&amp;gt;&amp;lt;td&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;b&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; Cell B Collapse Example&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;br&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;table&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;two&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;caption&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Separate Border Example&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/caption&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;tr&amp;gt;&amp;lt;td&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;a&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; Cell A Separate Example&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;tr&amp;gt;&amp;lt;td&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;b&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; Cell B Separate Example&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following result −&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;260px&quot; src=&quot;https://www.tutorialspoint.com/css/src/table.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The border-spacing Property&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The border-spacing property specifies the distance that separates adjacent cells&#39;. borders. It can take either one or two values; these should be units of length.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;If you provide one value, it will applies to both vertical and horizontal borders. Or you can specify two values, in which case, the first refers to the horizontal spacing and the second to the vertical spacing −&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
  &lt;b style=&quot;font-weight: 640;&quot;&gt;NOTE&lt;/b&gt; − Unfortunately, this property does not work in Netscape 7 or IE 6.
&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(214, 214, 214); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-x: auto; padding: 5px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&amp;lt;style type=&quot;text/css&quot;&amp;gt;   /* If you provide one value */   table.example {border-spacing:10px;}   /* This is how you can provide two values */   table.example {border-spacing:10px; 15px;} &amp;lt;/style&amp;gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Now let&#39;s modify the previous example and see the effect −&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/XqclEm&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;text/css&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; table&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;one &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;collapse&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;separate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;400px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;spacing&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; table&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;two &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;collapse&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;separate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;400px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;spacing&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;50px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;table&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;one&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;1&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;caption&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Separate Border Example with border-spacing&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/caption&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; Cell A Collapse Example&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; Cell B Collapse Example&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;br&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;table&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;two&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;1&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;caption&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Separate Border Example with border-spacing&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/caption&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; Cell A Separate Example&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; Cell B Separate Example&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following result −&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;360px&quot; src=&quot;https://www.tutorialspoint.com/css/src/table1.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The caption-side Property&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The caption-side property allows you to specify where the content of a &amp;lt;caption&amp;gt; element should be placed in relationship to the table. The table that follows lists the possible values.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;This property can have one of the four values&amp;nbsp;&lt;em&gt;top, bottom, left&amp;nbsp;&lt;/em&gt;or&amp;nbsp;&lt;em&gt;right&lt;/em&gt;. The following example uses each value.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
  &lt;b style=&quot;font-weight: 640;&quot;&gt;NOTE&lt;/b&gt; − These properties may not work with your IE Browser.
&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/Wyxhhe&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;text/css&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; caption&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;top &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;caption&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;side&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; caption&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;bottom &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;caption&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;side&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; caption&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;left &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;caption&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;side&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; caption&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;right &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;caption&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;side&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;table&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;400px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;caption&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;top&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This caption will appear at the top &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/caption&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;tr&amp;gt;&amp;lt;td&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; Cell A&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;tr&amp;gt;&amp;lt;td&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; Cell B&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;br&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;table&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;400px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;caption&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;bottom&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This caption will appear at the bottom &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/caption&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;tr&amp;gt;&amp;lt;td&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; Cell A&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;tr&amp;gt;&amp;lt;td&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; Cell B&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;br&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;table&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;400px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;caption&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;left&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This caption will appear at the left &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/caption&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;tr&amp;gt;&amp;lt;td&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; Cell A&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;tr&amp;gt;&amp;lt;td&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; Cell B&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;br&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;table&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;400px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;caption&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;right&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This caption will appear at the right &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/caption&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;tr&amp;gt;&amp;lt;td&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; Cell A&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;tr&amp;gt;&amp;lt;td&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; Cell B&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;h1&gt;Boarders&lt;/h1&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The&amp;nbsp;&lt;em&gt;border&lt;/em&gt; properties allow you to specify how the border of the box representing an element should look. There are three properties of a border you can change −&lt;/p&gt;
&lt;ul class=&quot;list&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0.625rem; margin-top: 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The&amp;nbsp;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;border-color&lt;/b&gt; specifies the color of a border.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The&amp;nbsp;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;border-style&lt;/b&gt; specifies whether a border should be solid, dashed line, double line, or one of the other possible values.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The&amp;nbsp;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;border-width&lt;/b&gt; specifies the width of a border.
    &lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Now, we will see how to use these properties with examples.&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The border-color Property&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The border-color property allows you to change the color of the border surrounding an element. You can individually change the color of the bottom, left, top and right sides of an element&#39;s border using the properties −&lt;/p&gt;
&lt;ul class=&quot;list&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0.625rem; margin-top: 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;border-bottom-color&lt;/b&gt; changes the color of bottom border.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;border-top-color&lt;/b&gt; changes the color of top border.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;border-left-color&lt;/b&gt; changes the color of left border.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;border-right-color&lt;/b&gt; changes the color of right border.
    &lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The following example shows the effect of all these properties −&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/VHb8Ca&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;text/css&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;example1 &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:#&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;009900&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;/* Green */&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:#&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;FF0000&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;/* Red */&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:#&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;330000&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;/* Black */&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:#&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;0000CC&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;/* Blue */&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;example2 &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:#&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;009900&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;/* Green */&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;example1&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This example is showing all borders in different colors. &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;example2&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This example is showing all borders in green color only. &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following result −&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;100px&quot; src=&quot;https://www.tutorialspoint.com/css/src/boarder.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The border-style Property&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The border-style property allows you to select one of the following styles of border −&lt;/p&gt;
&lt;ul class=&quot;list&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0.625rem; margin-top: 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;none&lt;/b&gt; − No border. (Equivalent of border-width:0;)
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;solid&lt;/b&gt; − Border is a single solid line.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;dotted&lt;/b&gt; − Border is a series of dots.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;dashed&lt;/b&gt; − Border is a series of short lines.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;double&lt;/b&gt; − Border is two solid lines.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;groove&lt;/b&gt; − Border looks as though it is carved into the page.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;ridge&lt;/b&gt; − Border looks the opposite of groove.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;inset&lt;/b&gt; − Border makes the box look like it is embedded in the page.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;outset&lt;/b&gt; − Border makes the box look like it is coming out of the canvas.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;hidden&lt;/b&gt; − Same as none, except in terms of border-conflict resolution for table elements.
    &lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;You can individually change the style of the bottom, left, top, and right borders of an element using the following properties −&lt;/p&gt;
&lt;ul class=&quot;list&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0.625rem; margin-top: 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;border-bottom-style&lt;/b&gt; changes the style of bottom border.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;border-top-style&lt;/b&gt; changes the style of top border.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;border-left-style&lt;/b&gt; changes the style of left border.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;border-right-style&lt;/b&gt; changes the style of right border.
    &lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The following example shows all these border styles −&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/A2f5i7&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;4px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is a border with none width. &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;4px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;solid&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is a solid border. &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;4px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;dashed&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is a dashed border. &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;4px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;double&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is a double border. &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;4px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;groove&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is a groove border. &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;4px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;ridge&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is a ridge  border. &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;4px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;inset&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is a inset border. &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;4px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;outset&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is a outset border. &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;4px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;hidden&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is a hidden border. &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;4px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;solid&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;dashed&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;groove&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;double&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is a a border with four different styles. &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following result −&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;420px&quot; src=&quot;https://www.tutorialspoint.com/css/src/boarder1.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The border-width Property&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The border-width property allows you to set the width of an element borders. The value of this property could be either a length in px, pt or cm or it should be set to&amp;nbsp;&lt;em&gt;thin, medium or thick.&lt;/em&gt;&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;You can individually change the width of the bottom, top, left, and right borders of an element using the following properties −&lt;/p&gt;
&lt;ul class=&quot;list&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0.625rem; margin-top: 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;border-bottom-width&lt;/b&gt; changes the width of bottom border.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;border-top-width&lt;/b&gt; changes the width of top border.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;border-left-width&lt;/b&gt; changes the width of left border.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;border-right-width&lt;/b&gt; changes the width of right border.
    &lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The following example shows all these border width −&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/dz1fTw&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;4px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;solid&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is a solid border whose width is 4px. &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;4pt&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;solid&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is a solid border whose width is 4pt. &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;thin&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;solid&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is a solid border whose width is thin. &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;medium&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;solid&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is a solid border whose width is medium; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;thick&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;solid&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is a solid border whose width is thick. &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;4px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;2px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;solid&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is a a border with four different width. &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;/pre&gt;

&lt;h1&gt;Margins&lt;/h1&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The&amp;nbsp;&lt;em&gt;margin&lt;/em&gt; property defines the space around an HTML element. It is possible to use negative values to overlap content.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The values of the margin property are not inherited by the child elements. Remember that the adjacent vertical margins (top and bottom margins) will collapse into each other so that the distance between the blocks is not the sum of the margins, but only the greater of the two margins or the same size as one margin if both are equal.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;We have the following properties to set an element margin.&lt;/p&gt;
&lt;ul class=&quot;list&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0.625rem; margin-top: 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The&amp;nbsp;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;margin&lt;/b&gt; specifies a shorthand property for setting the margin properties in one declaration.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The&amp;nbsp;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;margin-bottom&lt;/b&gt; specifies the bottom margin of an element.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The&amp;nbsp;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;margin-top&lt;/b&gt; specifies the top margin of an element.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The&amp;nbsp;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;margin-left&lt;/b&gt; specifies the left margin of an element.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The&amp;nbsp;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;margin-right&lt;/b&gt; specifies the right margin of an element.
    &lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Now, we will see how to use these properties with examples.&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The Margin Property&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The margin property allows you set all of the properties for the four margins in one declaration. Here is the syntax to set margin around a paragraph −&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Here is an example −&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/65loy5&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; all four margins will be 15px &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;%;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; top and bottom margin will be 10px, left and right margin will be 2%          of the total width of the document. &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; top margin will be 10px, left and right margin will be 2% of the          total width of the document, bottom margin will be -10px &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; top margin will be 10px, right margin will be 2% of the total          width of the document, bottom margin will be -10px, left margin          will be set by the browser &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following result −&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;270px&quot; src=&quot;https://www.tutorialspoint.com/css/src/margins.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The margin-bottom Property&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The margin-bottom property allows you set bottom margin of an element. It can have a value in length, % or auto.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Here is an example −&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/t9tAav&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is a paragraph with a specified bottom margin &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;%;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is another paragraph with a specified bottom margin in percent &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following result −&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;120px&quot; src=&quot;https://www.tutorialspoint.com/css/src/margins1.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The margin-top Property&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The margin-top property allows you set top margin of an element. It can have a value in length, % or auto.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Here is an example −&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/lwkPXg&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is a paragraph with a specified top margin &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;%;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is another paragraph with a specified top margin in percent &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following result −&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;120px&quot; src=&quot;https://www.tutorialspoint.com/css/src/margins2.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The margin-left Property&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The margin-left property allows you set left margin of an element. It can have a value in length, % or auto.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Here is an example −&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/gag0AT&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is a paragraph with a specified left margin &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;%;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is another paragraph with a specified top margin in percent &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following result −&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;100px&quot; src=&quot;https://www.tutorialspoint.com/css/src/margins3.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The margin-right Property&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The margin-right property allows you set right margin of an element. It can have a value in length, % or auto.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Here is an example −&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/5cx2jl&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is a paragraph with a specified right margin &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;%;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is another paragraph with a specified right margin in percent &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following result −&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;100px&quot; src=&quot;https://www.tutorialspoint.com/css/src/margins4.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;Lists&lt;/h1&gt;

&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Lists are very helpful in conveying a set of either numbered or bullet points. This chapter teaches you how to control list type, position, style, etc., using CSS.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;We have the following five CSS properties, which can be used to control lists −&lt;/p&gt;
&lt;ul class=&quot;list&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0.625rem; margin-top: 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The&amp;nbsp;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;list-style-type&lt;/b&gt; allows you to control the shape or appearance of the marker.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The&amp;nbsp;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;list-style-position&lt;/b&gt; specifies whether a long point that wraps to a second line should align with the first line or start underneath the start of the marker.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The&amp;nbsp;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;list-style-image&lt;/b&gt; specifies an image for the marker rather than a bullet point or number.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The&amp;nbsp;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;list-style&lt;/b&gt; serves as shorthand for the preceding properties.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The&amp;nbsp;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;marker-offset&lt;/b&gt; specifies the distance between a marker and the text in the list.
    &lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Now, we will see how to use these properties with examples.&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The list-style-type Property&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The&amp;nbsp;&lt;em&gt;list-style-type&lt;/em&gt; property allows you to control the shape or style of bullet point (also known as a marker) in the case of unordered lists and the style of numbering characters in ordered lists.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Here are the values which can be used for an unordered list −&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: transparent; border-collapse: collapse; border-spacing: 0px; border: 1px solid rgb(221, 221, 221); color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 20px; max-width: 100%; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; width: 722.4px; word-spacing: 0px;&quot;&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th style=&quot;background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top; width: 40.8px;&quot;&gt;Sr.No.&lt;/th&gt;
      &lt;th style=&quot;background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;Value &amp;amp; Description&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;1&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;none&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;NA&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;2&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;disc (default)&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;A filled-in circle&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;3&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;circle&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;An empty circle&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;4&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;square&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;A filled-in square&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Here are the values, which can be used for an ordered list −&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: transparent; border-collapse: collapse; border-spacing: 0px; border: 1px solid rgb(221, 221, 221); color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 20px; max-width: 100%; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; width: 722.4px; word-spacing: 0px;&quot;&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th style=&quot;background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;Value&lt;/th&gt;
      &lt;th style=&quot;background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;Description&lt;/th&gt;
      &lt;th style=&quot;background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;Example&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;decimal&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;Number&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;1,2,3,4,5&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: middle;&quot;&gt;decimal-leading-zero&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: middle;&quot;&gt;0 before the number&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;01, 02, 03, 04, 05&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;lower-alpha&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;Lowercase alphanumeric characters&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;a, b, c, d, e&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: middle;&quot;&gt;upper-alpha&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: middle;&quot;&gt;Uppercase alphanumeric characters&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;A, B, C, D, E&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;lower-roman&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;Lowercase Roman numerals&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;i, ii, iii, iv, v&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: middle;&quot;&gt;upper-roman&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: middle;&quot;&gt;Uppercase Roman numerals&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;I, II, III, IV, V&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: middle;&quot;&gt;lower-greek&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: middle;&quot;&gt;The marker is lower-greek&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;alpha, beta, gamma&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;lower-latin&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;The marker is lower-latin&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;a, b, c, d, e&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;upper-latin&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;The marker is upper-latin&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;A, B, C, D, E&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;hebrew&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top; width: 380px;&quot;&gt;The marker is traditional Hebrew numbering&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: middle;&quot;&gt;armenian&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;The marker is traditional Armenian numbering&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: middle;&quot;&gt;georgian&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;The marker is traditional Georgian numbering&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;cjk-ideographic&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: middle;&quot;&gt;The marker is plain ideographic numbers&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;hiragana&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;The marker is hiragana&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;a, i, u, e, o, ka, ki&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: middle;&quot;&gt;katakana&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: middle;&quot;&gt;The marker is katakana&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;A, I, U, E, O, KA, KI&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: middle;&quot;&gt;hiragana-iroha&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: middle;&quot;&gt;The marker is hiragana-iroha&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;i, ro, ha, ni, ho, he, to&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;katakana-iroha&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: middle;&quot;&gt;The marker is katakana-iroha&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;I, RO, HA, NI, HO, HE, TO&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Here is an example −&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/9LSg6t&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;ul&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;circle&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Maths&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Social Science&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Physics&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;ul&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;square&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Maths&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Social Science&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Physics&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;ol&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;decimal&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Maths&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Social Science&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Physics&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/ol&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;ol&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;lower&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;alpha&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Maths&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Social Science&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Physics&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/ol&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;ol&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;lower&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;roman&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Maths&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Social Science&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Physics&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/ol&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following result −&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;370px&quot; src=&quot;https://www.tutorialspoint.com/css/src/list.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The list-style-position Property&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The&amp;nbsp;&lt;em&gt;list-style-position&lt;/em&gt; property indicates whether the marker should appear inside or outside of the box containing the bullet points. It can have one the two values −&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: transparent; border-collapse: collapse; border-spacing: 0px; border: 1px solid rgb(221, 221, 221); color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 20px; max-width: 100%; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; width: 722.4px; word-spacing: 0px;&quot;&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th style=&quot;background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top; width: 40.8px;&quot;&gt;Sr.No.&lt;/th&gt;
      &lt;th style=&quot;background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;Value &amp;amp; Description&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;1&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;none&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;NA&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;2&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;inside&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;If the text goes onto a second line, the text will wrap underneath the marker. It will also appear indented to where the text would have started if the list had a value of outside.&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;3&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;outside&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;If the text goes onto a second line, the text will be aligned with the start of the first line (to the right of the bullet).&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Here is an example −&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/C83PnR&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;ul&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;circle&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; list&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;stlye&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;outside&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Maths&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Social Science&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Physics&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;ul&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;square&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;inside&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Maths&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Social Science&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Physics&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;ol&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;decimal&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;stlye&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;outside&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Maths&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Social Science&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Physics&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/ol&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;ol&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;lower&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;alpha&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;inside&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Maths&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Social Science&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Physics&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/ol&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following result −&lt;/p&gt;

&lt;h1&gt;Padding&lt;/h1&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The&amp;nbsp;&lt;em&gt;padding&lt;/em&gt; property allows you to specify how much space should appear between the content of an element and its border −&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The value of this attribute should be either a length, a percentage, or the word&amp;nbsp;&lt;em&gt;inherit&lt;/em&gt;. If the value is&amp;nbsp;&lt;em&gt;inherit&lt;/em&gt;, it will have the same padding as its parent element. If a percentage is used, the percentage is of the containing box.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The following CSS properties can be used to control lists. You can also set different values for the padding on each side of the box using the following properties −&lt;/p&gt;
&lt;ul class=&quot;list&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0.625rem; margin-top: 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The&amp;nbsp;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;padding-bottom&lt;/b&gt; specifies the bottom padding of an element.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The&amp;nbsp;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;padding-top&lt;/b&gt; specifies the top padding of an element.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The&amp;nbsp;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;padding-left&lt;/b&gt; specifies the left padding of an element.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The&amp;nbsp;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;padding-right&lt;/b&gt; specifies the right padding of an element.
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The&amp;nbsp;
      &lt;b style=&quot;font-weight: 640;&quot;&gt;padding&lt;/b&gt; serves as shorthand for the preceding properties.
    &lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Now, we will see how to use these properties with examples.&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The padding-bottom Property&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The&amp;nbsp;&lt;em&gt;padding-bottom&lt;/em&gt; property sets the bottom padding (space) of an element. This can take a value in terms of length of %.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Here is an example −&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/eLlWo2&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is a paragraph with a specified bottom padding &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;%;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is another paragraph with a specified bottom padding in percent &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following result −&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;140px&quot; src=&quot;https://www.tutorialspoint.com/css/src/padding.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The padding-top Property&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The&amp;nbsp;&lt;em&gt;padding-top&lt;/em&gt; property sets the top padding (space) of an element. This can take a value in terms of length of %.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Here is an example −&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/JND6ee&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is a paragraph with a specified top padding &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;%;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is another paragraph with a specified top padding in percent &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following result −&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;130px&quot; src=&quot;https://www.tutorialspoint.com/css/src/padding1.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The padding-left Property&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The&amp;nbsp;&lt;em&gt;padding-left&lt;/em&gt; property sets the left padding (space) of an element. This can take a value in terms of length of %.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Here is an example −&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/dvExfh&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is a paragraph with a specified left padding &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;%;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is another paragraph with a specified left padding in percent &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following result −&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;90px&quot; src=&quot;https://www.tutorialspoint.com/css/src/padding2.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The padding-right Property&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The&amp;nbsp;&lt;em&gt;padding-right&lt;/em&gt; property sets the right padding (space) of an element. This can take a value in terms of length of %.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Here is an example −&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/iEqv9R&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is a paragraph with a specified right padding &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;%;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This is another paragraph with a specified right padding in percent &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following result −&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;100px&quot; src=&quot;https://www.tutorialspoint.com/css/src/padding3.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The Padding Property&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The&amp;nbsp;&lt;em&gt;padding&lt;/em&gt; property sets the left, right, top and bottom padding (space) of an element. This can take a value in terms of length of %.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Here is an example −&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/xXx57M&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; all four padding will be 15px &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;%;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; top and bottom padding will be 10px, left and right         padding will be 2% of the total width of the document. &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; top padding will be 10px, left and right padding will          be 2% of the total width of the document, bottom padding will be 10px &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; top padding will be 10px, right padding will be 2% of         the total width of the document, bottom padding and top padding will be 10px &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following result −&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;300px&quot; src=&quot;https://www.tutorialspoint.com/css/src/padding4.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;Cursors&lt;/h1&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The&amp;nbsp;&lt;em&gt;cursor&lt;/em&gt; property of CSS allows you to specify the type of cursor that should be displayed to the user.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;One good usage of this property is in using images for submit buttons on forms. By default, when a cursor hovers over a link, the cursor changes from a pointer to a hand. However, it does not change form for a submit button on a form. Therefore, whenever someone hovers over an image that is a submit button, it provides a visual clue that the image is clickable.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The following table shows the possible values for the cursor property −&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: transparent; border-collapse: collapse; border-spacing: 0px; border: 1px solid rgb(221, 221, 221); color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 20px; max-width: 100%; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; width: 722.4px; word-spacing: 0px;&quot;&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th style=&quot;background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;Sr.No.&lt;/th&gt;
      &lt;th style=&quot;background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;Value &amp;amp; Description&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;1&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;auto&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;Shape of the cursor depends on the context area it is over. For example an I over text, a hand over a link, and so on...&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;2&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;crosshair&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;A crosshair or plus sign&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;3&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;default&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;An arrow&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;4&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;pointer&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;A pointing hand (in IE 4 this value is hand)&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;5&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;move&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The I bar&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;6&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;e-resize&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The cursor indicates that an edge of a box is to be moved right (east)&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;7&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;ne-resize&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The cursor indicates that an edge of a box is to be moved up and right (north/east)&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;8&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;nw-resize&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The cursor indicates that an edge of a box is to be moved up and left (north/west)&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;9&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;n-resize&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The cursor indicates that an edge of a box is to be moved up (north)&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;10&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;se-resize&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The cursor indicates that an edge of a box is to be moved down and right (south/east)&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;11&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;sw-resize&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The cursor indicates that an edge of a box is to be moved down and left (south/west)&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;12&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;s-resize&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The cursor indicates that an edge of a box is to be moved down (south)&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;13&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;w-resize&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The cursor indicates that an edge of a box is to be moved left (west)&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;14&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;text&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The I bar&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;15&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;wait&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;An hour glass&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;16&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;help&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;A question mark or balloon, ideal for use over help buttons&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;17&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;&amp;lt;url&amp;gt;&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;The source of a cursor image file&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
  &lt;b style=&quot;font-weight: 640;&quot;&gt;NOTE&lt;/b&gt; − You should try to use only these values to add helpful information for users, and in places, they would expect to see that cursor. For example, using the crosshair when someone hovers over a link can confuse visitors.
&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Here is an example −&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/6btsgw&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Move the mouse over the words to see the cursor change:&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;div&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Auto&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;div&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;crosshair&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Crosshair&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;div&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Default&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;div&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;pointer&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Pointer&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;div&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;move&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Move&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;div&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;resize&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;e-resize&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;div&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;ne&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;resize&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;ne-resize&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;div&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;nw&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;resize&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;nw-resize&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;div&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;resize&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;n-resize&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;div&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;se&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;resize&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;se-resize&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;div&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;sw&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;resize&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;sw-resize&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;div&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;resize&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;s-resize&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;div&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;resize&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;w-resize&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;div&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;div&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;wait&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;wait&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;div&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;help&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;help&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following result −&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;340px&quot; src=&quot;https://www.tutorialspoint.com/css/src/cursors.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;Pseudo Class&lt;/h1&gt;
&lt;p&gt;x&quot; style=&quot;background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;&quot;&amp;gt;&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The :hover pseudo-class&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The following example demonstrates how to use the&amp;nbsp;&lt;em&gt;:hover&lt;/em&gt; class to change the color of links when we bring a mouse pointer over that link. Possible values could be any color name in any valid format.&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/Esz4Tz&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;text/css&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; a&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;hover &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;#FFCC00}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;a&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Bring Mouse Here&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following link. Now you bring your mouse over this link and you will see that it changes its color to yellow.&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;70px&quot; src=&quot;https://www.tutorialspoint.com/css/src/pseudo2.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The :active pseudo-class&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The following example demonstrates how to use the&amp;nbsp;&lt;em&gt;:active&lt;/em&gt; class to change the color of active links. Possible values could be any color name in any valid format.&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/d6n1xs&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;text/css&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; a&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;active &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;#FF00CC}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;a&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Click This Link&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following link. When a user clicks it, the color changes to pink.&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;70px&quot; src=&quot;https://www.tutorialspoint.com/css/src/pseudo3.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The :focus pseudo-class&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The following example demonstrates how to use the&amp;nbsp;&lt;em&gt;:focus&lt;/em&gt; class to change the color of focused links. Possible values could be any color name in any valid format.&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/9zLDxN&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;text/css&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; a&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;focus &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;#0000FF}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;a&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Click this Link&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following link. When this link gets focused, its color changes to orange. The color changes back when it loses focus.&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;70px&quot; src=&quot;https://www.tutorialspoint.com/css/src/pseudo4.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The :first-child pseudo-class&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The&amp;nbsp;&lt;em&gt;:first-child&lt;/em&gt; pseudo-class matches a specified element that is the first child of another element and adds special style to that element that is the first child of some other element.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;To make :first-child work in IE &amp;lt;!DOCTYPE&amp;gt; must be declared at the top of document.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;For example, to indent the first paragraph of all &amp;lt;div&amp;gt; elements, you could use this definition −&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/HOrHZk&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;text/css&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; div &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;first&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;child &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; text&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;indent&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;First paragraph in div. This paragraph will be indented&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Second paragraph in div. This paragraph will not be indented&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;But it will not match the paragraph in this HTML:&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Heading&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;The first paragraph inside the div. This paragraph will not be effected.&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following result −&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;200px&quot; src=&quot;https://www.tutorialspoint.com/css/src/pseudo5.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The :lang pseudo-class&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The language pseudo-class&amp;nbsp;&lt;em&gt;:lang&lt;/em&gt;, allows constructing selectors based on the language setting for specific tags.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;This class is useful in documents that must appeal to multiple languages that have different conventions for certain language constructs. For example, the French language typically uses angle brackets (&amp;lt; and &amp;gt;) for quoting purposes, while the English language uses quote marks (&#39; and &#39;).&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;In a document that needs to address this difference, you can use the :lang pseudo-class to change the quote marks appropriately. The following code changes the &amp;lt;blockquote&amp;gt; tag appropriately for the language being used −&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/UUgyfo&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;text/css&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;/* Two levels of quotes for two languages*/&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;lang&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;en&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; quotes&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;&#39;&quot;&#39;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;&#39;&quot;&#39;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;&quot;&#39;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;&quot;&#39;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;lang&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;fr&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; quotes&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;&quot;&amp;lt;&amp;lt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;&quot;&amp;gt;&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;&quot;&amp;lt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;&quot;&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;q&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;lang&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;fr&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;A quote in a paragraph&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/q&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The :lang selectors will apply to all the elements in the document. However, not all elements make use of the quotes property, so the effect will be transparent for most elements.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following result −&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;70px&quot; src=&quot;https://www.tutorialspoint.com/css/src/pseudo6.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;Pseudo Elements&lt;/h1&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;CSS pseudo-elements are used to add special effects to some selectors. You do not need to use JavaScript or any other script to use those effects. A simple syntax of pseudo-element is as follows −&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(214, 214, 214); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-x: auto; padding: 5px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;selector:pseudo-element {property: value}&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;CSS classes can also be used with pseudo-elements −&lt;/p&gt;
&lt;pre class=&quot;result notranslate&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(214, 214, 214); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-x: auto; padding: 5px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;selector.class:pseudo-element {property: value}&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The most commonly used pseudo-elements are as follows −&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: transparent; border-collapse: collapse; border-spacing: 0px; border: 1px solid rgb(221, 221, 221); color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 20px; max-width: 100%; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; width: 722.4px; word-spacing: 0px;&quot;&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th style=&quot;background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;Sr.No.&lt;/th&gt;
      &lt;th style=&quot;background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;Value &amp;amp; Description&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;1&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;:first-line&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;Use this element to add special styles to the first line of the text in a selector.&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;2&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;:first-letter&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;Use this element to add special style to the first letter of the text in a selector.&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;3&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;:before&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;Use this element to insert some content before an element.&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;4&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;:after&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;Use this element to insert some content after an element.&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The :first-line pseudo-element&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The following example demonstrates how to use the&amp;nbsp;&lt;em&gt;:first-line&lt;/em&gt; element to add special effects to the first line of elements in the document.&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/QHKVm0&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;text/css&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;first&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;line &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; text&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;decoration&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; underline&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;noline&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;first&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;line &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; text&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;decoration&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; none&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;noline&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This line would not have any underline because this belongs to nline class. &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; The first line of this paragraph will be underlined as defined in the          CSS rule above. Rest of the lines in this paragraph will remain normal.          This example shows how to use :first-line pseduo element to give effect          to the first line of any HTML element. &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following link −&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;130px&quot; src=&quot;https://www.tutorialspoint.com/css/src/pseudo_element.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The :first-letter pseudo-element&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The following example demonstrates how to use the&amp;nbsp;&lt;em&gt;:first-letter&lt;/em&gt; element to add special effects to the first letter of elements in the document.&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/p6eKse&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;text/css&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;first&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;letter &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; font&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;5em&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;normal&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;first&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;letter &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; font&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;normal&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; First character of this paragraph will be normal and will have font size 10 px; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; The first character of this paragraph will be 5em big as defined in the          CSS rule above. Rest of the characters in this paragraph will remain          normal. This example shows how to use :first-letter pseduo element          to give effect to the first characters  of any HTML element. &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following black link −&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;220px&quot; src=&quot;https://www.tutorialspoint.com/css/src/pseudo_element1.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The :before pseudo-element&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The following example demonstrates how to use the&amp;nbsp;&lt;em&gt;:before&lt;/em&gt; element to add some content before any element.&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/r3h9gd&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;text/css&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;before &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; content&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; url&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;/images/&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;bullet&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;gif&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This line will be preceded by a bullet.&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This line will be preceded by a bullet.&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This line will be preceded by a bullet.&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following black link −&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;130px&quot; src=&quot;https://www.tutorialspoint.com/css/src/pseudo_element2.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The :after pseudo-element&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The following example demonstrates how to use the&amp;nbsp;&lt;em&gt;:after&lt;/em&gt; element to add some content after any element.&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/KYI15B&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;style&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;text/css&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; p&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;after &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; content&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; url&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;/images/&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;bullet&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;gif&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This line will be succeeded by a bullet.&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This line will be succeeded by a bullet.&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; This line will be succeeded by a bullet.&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following black link −&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;120px&quot; src=&quot;https://www.tutorialspoint.com/css/src/pseudo_element3.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;Validation&lt;/h1&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Validation is the process of checking something against a rule. When you are a beginner, it is very common that you will commit many mistakes in writing your CSS rules. How you will make sure whatever you have written is 100% accurate and up to the W3 quality standards?&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;If you use CSS, your code needs to be correct. Improper code may cause unexpected results in how your page looks or functions.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;But if you want to validate your CSS style sheet embedded in an (X)HTML document, you should first check that the (X)HTML you use is valid.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Tool to check the validity of (X)HTML document:&amp;nbsp;
  &lt;b style=&quot;font-weight: 640;&quot;&gt;Validate (X)HTML document&lt;/b&gt;.
&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;You can use the following tools to check the validity of your CSS.&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: transparent; border-collapse: collapse; border-spacing: 0px; border: 1px solid rgb(221, 221, 221); color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 20px; max-width: 100%; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; width: 722.4px; word-spacing: 0px;&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot; width=&quot;20%&quot;&gt;
        &lt;a href=&quot;http://jigsaw.w3.org/css-validator/&quot; rel=&quot;nofollow&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 100% 50%; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/link-icon.png&amp;quot;) right center no-repeat; color: #313131; font-weight: normal; padding-bottom: 2px; padding-right: 22px; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;
          &lt;img alt=&quot;W3 CSS Validator&quot; src=&quot;https://www.tutorialspoint.com/css/images/css_validation.gif&quot; style=&quot;border-style: none; max-width: 100%; padding-bottom: 4px;&quot; /&gt;
        &lt;/a&gt;
      &lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;W3C CSS Validator (World Wide Web Consortium), This validator checks your css by either file upload, direct input, or using URI - one page at a time. This validator helps you to locate all the errors in your CSS.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;a href=&quot;http://www.htmlhelp.com/tools/csscheck/&quot; rel=&quot;nofollow&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 100% 50%; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/link-icon.png&amp;quot;) right center no-repeat; color: #313131; font-weight: normal; padding-bottom: 2px; padding-right: 22px; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;
          &lt;img alt=&quot;WDG - CSS validator&quot; src=&quot;http://www.htmlhelp.com/icon/wdglogo-small.gif&quot; style=&quot;border-style: none; max-width: 100%; padding-bottom: 4px;&quot; /&gt;
        &lt;/a&gt;
      &lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;The WDG CSS check validator, lets you validate your css by direct input, file upload, and using URI. Errors will be listed by line and column numbers if you have any. Errors usually come with links to explain the reason of error.&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;A CSS validator checks your Cascading Style Sheets to make sure that they comply with the CSS standards set by the W3 Consortium. There are a few validators which will also tell you which CSS features are supported by which browsers (since not all browsers are equal in their CSS implementation).&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Why Validate Your HTML Code?&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;There are a number of reasons why you should validate your code. But major ones are −&lt;/p&gt;
&lt;ul class=&quot;list&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 0.625rem; margin-top: 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;It Helps Cross-Browser, Cross-Platform, and Future Compatibility.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;A good quality website increases search engine visibility.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-origin: initial; background-position: 0px 3px; background-repeat: no-repeat; background-size: initial; background: url(&amp;quot;/images/icon-bullet.png&amp;quot;) 0px 3px no-repeat; list-style: none; margin-bottom: 5px; padding: 0px 0px 0px 19px;&quot;&gt;
    &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;Professionalism: As a web developer, your code should not raise errors while seen by the visitors.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;Rounded Corners&lt;/h1&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;CSS3 Rounded corners are used to add special colored corner to body or text by using the border-radius property.A simple syntax of rounded corners is as follows −&lt;/p&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;#rcorners7 {&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;radius&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;60px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; background&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;#FF0000;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; padding&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;200px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; height&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;150px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The following table shows the possible values for Rounded corners as follows −&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: transparent; border-collapse: collapse; border-spacing: 0px; border: 1px solid rgb(221, 221, 221); color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 20px; max-width: 100%; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; width: 722.4px; word-spacing: 0px;&quot;&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th style=&quot;background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;Sr.No.&lt;/th&gt;
      &lt;th style=&quot;background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;Value &amp;amp; Description&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;1&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;border-radius&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;Use this element for setting four boarder radius property&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;2&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;border-top-left-radius&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;Use this element for setting the boarder of top left corner&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;3&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;border-top-right-radius&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;Use this element for setting the boarder of top right corner&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;4&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;border-bottom-right-radius&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;Use this element for setting the boarder of bottom right corner&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;5&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;border-bottom-left-radius&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;Use this element for setting the boarder of bottom left corner&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Example&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;This property can have three values. The following example uses both the values −&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/Bn2y0b&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;#rcorners1 {&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;radius&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; background&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;#8AC007;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; padding&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;200px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; height&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;150px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;#rcorners2 {&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;radius&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;2px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;#8AC007;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; padding&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;200px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; height&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;150px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;#rcorners3 {&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;radius&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; background&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; url&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;/css/&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;images&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;logo&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;png&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; background&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; left top&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; background&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;repeat&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; repeat&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; padding&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;200px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; height&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;150px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;rcorners1&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Rounded corners!&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;rcorners2&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Rounded corners!&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;rcorners3&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;Rounded corners!&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following result −&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;400px&quot; src=&quot;https://www.tutorialspoint.com/css/src/round_corner.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Each Corner property&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;We can specify the each corner property as shown below example −&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/uNhKfr&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;#rcorners1 {&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;radius&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;50px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;30px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;5px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; background&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;#a44170;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; padding&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;100px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; height&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;100px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;#rcorners2 {&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;radius&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;50px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;30px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; background&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;#a44170;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; padding&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;100px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; height&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;100px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;#rcorners3 {&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;radius&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;50px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; background&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;#a44170;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; padding&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;100px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; height&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;100px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;rcorners1&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;rcorners2&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;p&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;rcorners3&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following result −&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;400px&quot; src=&quot;https://www.tutorialspoint.com/css/src/each_boarder.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;2D Transformation&lt;/h1&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;2D transforms are used to re-change the element structure as translate, rotate, scale, and skew.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The following table has contained common values which are used in 2D transforms −&lt;/p&gt;
&lt;table class=&quot;table table-bordered&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: transparent; border-collapse: collapse; border-spacing: 0px; border: 1px solid rgb(221, 221, 221); color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 20px; max-width: 100%; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; width: 722.4px; word-spacing: 0px;&quot;&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th style=&quot;background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;Sr.No.&lt;/th&gt;
      &lt;th style=&quot;background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;Value &amp;amp; Description&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;1&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;matrix(n,n,n,n,n,n)&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;Used to defines matrix transforms with six values&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;2&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;translate(x,y)&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;Used to transforms the element along with x-axis and y-axis&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;3&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;translateX(n)&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;Used to transforms the element along with x-axis&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;4&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;translateY(n)&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;Used to transforms the element along with y-axis&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;5&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;scale(x,y)&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;Used to change the width and height of element&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;6&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;scaleX(n)&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;Used to change the width of element&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;7&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;scaleY(n)&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;Used to change the height of element&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;8&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;rotate(angle)&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;Used to rotate the element based on an angle&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;9&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;skewX(angle)&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;Used to defines skew transforms along with x axis&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td class=&quot;ts&quot; style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;10&lt;/td&gt;
      &lt;td style=&quot;border: 1px solid rgb(221, 221, 221); line-height: 1.42857; padding: 8px; vertical-align: top;&quot;&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;
          &lt;b style=&quot;font-weight: 640;&quot;&gt;skewY(angle)&lt;/b&gt;
        &lt;/p&gt;
        &lt;p style=&quot;color: black; font-size: 15px; margin: 0.5em 0.2em 0.6em; padding: 0px; text-align: justify;&quot;&gt;Used to defines skew transforms along with y axis&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The following examples are shown the sample of all above properties.&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Rotate 20 degrees&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Box rotation with 20 degrees angle as shown below −&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/vk1kmP&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; div &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;300px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; height&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;100px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; background&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; pink&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; div&lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;#myDiv {&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;/* IE 9 */&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;ms&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; rotate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;20deg&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;/* Safari */&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;webkit&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; rotate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;20deg&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;/* Standard syntax */&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; transform&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; rotate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;20deg&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; Tutorials point.com. &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;div&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;myDiv&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; Tutorials point.com &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following result −&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;270px&quot; src=&quot;https://www.tutorialspoint.com/css/src/css3_2d1.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Rotate -20 degrees&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Box rotation with -20 degrees angle as shown below −&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/XeDShO&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; div &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;300px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; height&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;100px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; background&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; pink&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; div&lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;#myDiv {&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;/* IE 9 */&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;ms&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; rotate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(-&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;20deg&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;/* Safari */&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;webkit&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; rotate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(-&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;20deg&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;/* Standard syntax */&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; rotate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(-&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;20deg&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; Tutorials point.com. &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;div&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;myDiv&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; Tutorials point.com &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following result −&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;270px&quot; src=&quot;https://www.tutorialspoint.com/css/src/css3_2d2.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Skew X axis&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Box rotation with skew x-axis as shown below −&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/7XxYWI&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; div &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;300px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; height&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;100px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; background&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; pink&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; div&lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;#skewDiv {&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;/* IE 9 */&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;ms&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; skewX&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;20deg&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;/* Safari */&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;webkit&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; skewX&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;20deg&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;/* Standard syntax */&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; skewX&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;20deg&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; Tutorials point.com. &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;div&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;skewDiv&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; Tutorials point.com &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following result −&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;250px&quot; src=&quot;https://www.tutorialspoint.com/css/src/css3_2d3.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Skew Y axis&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Box rotation with skew y-axis as shown below −&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/14Ec6a&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; div &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;300px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; height&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;100px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; background&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; pink&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; div&lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;#skewDiv {&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;/* IE 9 */&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;ms&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; skewY&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;20deg&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;/* Safari */&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;webkit&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; skewY&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;20deg&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;/* Standard syntax */&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; skewY&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;20deg&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; Tutorials point.com. &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;div&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;skewDiv&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; Tutorials point.com &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It will produce the following result −&lt;/p&gt;
&lt;p&gt;
  &lt;iframe class=&quot;result&quot; height=&quot;300px&quot; src=&quot;https://www.tutorialspoint.com/css/src/css3_2d4.htm&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238) !important; border: 1px solid rgb(214, 214, 214) !important; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; width=&quot;660px&quot;&gt;&lt;/iframe&gt;
&lt;/p&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 23px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; line-height: 2rem; margin-bottom: 0.625rem; margin-top: 1.25rem; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Matrix transform&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Arial, Verdana, Tahoma; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0.5em 0.2em 0.6em; orphans: 2; padding: 0px; text-align: justify; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Box rotation with Matrix transforms as shown below −&lt;/p&gt;
&lt;div class=&quot;demo-view&quot; style=&quot;-webkit-text-stroke-width: 0px; color: rgba(0, 0, 0, 0.87); font-family: Arial, Verdana, Tahoma; font-size: 14px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; position: relative; text-align: right; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; top: 7px; white-space: normal; widows: 2; width: 723.65px; word-spacing: 0px;&quot;&gt;
  &lt;a class=&quot;demo&quot; href=&quot;http://tpcg.io/PayOg7&quot; rel=&quot;nofollow&quot; style=&quot;background: rgb(164, 65, 112); border: 0px solid rgb(240, 92, 2); color: white; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 13px; margin: -6px 17px 0px 0px; padding: 3px 10px; position: relative; right: unset; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;Live Demo&lt;/a&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint notranslate prettyprinted&quot; style=&quot;-webkit-text-stroke-width: 0px; background: rgb(238, 238, 238); border: 1px solid rgb(136, 136, 136); color: rgba(0, 0, 0, 0.87); font-family: monospace, monospace; font-size: 0.95em; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: -5px; orphans: 2; overflow-x: auto; padding: 2px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; div &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;300px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; height&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;100px&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; background&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; pink&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; border&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; solid black&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; div&lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;#myDiv1 {&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;/* IE 9 */&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;ms&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; matrix&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;0.3&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;/* Safari */&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;webkit&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; matrix&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;0.3&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;/* Standard syntax */&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; transform&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; matrix&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;0.3&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; Tutorials point.com. &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;div&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #660066;&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800;&quot;&gt;&quot;myDiv1&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; Tutorials point.com &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;h1&gt;3D Transformation&lt;/h1&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: &amp;quot;Segoe UI&amp;quot;, Arial, sans-serif; font-size: 32px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 10px 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;CSS 3D Transforms&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 1.2em; margin-top: 1.2em; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;CSS also supports 3D transformations.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 1.2em; margin-top: 1.2em; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Mouse over the elements below to see the difference between a 2D and a 3D transformation:&lt;/p&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; height: 80px; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
  &lt;div style=&quot;background: red; border-radius: 5px; border: 1px solid rgb(0, 0, 0); box-sizing: inherit; color: white; float: left; font-size: 15px; font-weight: bold; height: 70px; margin: 10px; padding: 10px; position: relative; transform: rotate(180deg); width: 80px;&quot;&gt;2D rotate&lt;/div&gt;
  &lt;div style=&quot;background: red; border-radius: 5px; border: 1px solid rgb(0, 0, 0); box-sizing: inherit; color: white; float: left; font-size: 15px; font-weight: bold; height: 70px; margin: 10px; padding: 10px; position: relative; width: 80px;&quot;&gt;3D rotate&lt;/div&gt;
&lt;/div&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 1.2em; margin-top: 1.2em; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;In this chapter you will learn about the following CSS property:&lt;/p&gt;
&lt;ul style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
  &lt;li style=&quot;box-sizing: inherit;&quot;&gt;
    &lt;code class=&quot;w3-codespan&quot; style=&quot;background-color: #f1f1f1; box-sizing: inherit; color: crimson; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15.75px; padding-left: 4px; padding-right: 4px;&quot;&gt;transform&lt;/code&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;hr style=&quot;-webkit-text-stroke-width: 0px; background-color: white; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 0px; border-top: 1px solid rgb(238, 238, 238); box-sizing: content-box; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; height: 0px; letter-spacing: normal; margin: 20px -16px; orphans: 2; overflow: visible; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; /&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: &amp;quot;Segoe UI&amp;quot;, Arial, sans-serif; font-size: 32px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 10px 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Browser Support&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 1.2em; margin-top: 1.2em; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The numbers in the table specify the first browser version that fully supports the property.&lt;/p&gt;
&lt;div class=&quot;w3-responsive&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; display: block; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-x: auto; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
  &lt;table class=&quot;browserref notranslate&quot; style=&quot;border-collapse: collapse; box-sizing: inherit; width: 1017.6px;&quot;&gt;
    &lt;thead&gt;
      &lt;tr style=&quot;background-color: white; box-sizing: inherit;&quot;&gt;
        &lt;th style=&quot;background-color: white; background-position: 50% 50%; background-repeat: no-repeat; border: 1px solid rgb(212, 212, 212); box-sizing: inherit; color: #555555; font-size: 16px; font-weight: normal; height: 44px; padding: 11px 5px 11px 16px; text-align: left; vertical-align: middle; width: 254.4px;&quot;&gt;Property&lt;/th&gt;
        &lt;th class=&quot;bsChrome&quot; style=&quot;background-color: white; background-image: url(&amp;quot;/images/compatible_chrome.gif&amp;quot;); background-position: 50% 50%; background-repeat: no-repeat; border: 1px solid rgb(212, 212, 212); box-sizing: inherit; color: #555555; font-weight: normal; height: 44px; padding: 11px 5px; vertical-align: middle; width: 152.8px;&quot; title=&quot;Chrome&quot;&gt;
          &lt;br /&gt;
        &lt;/th&gt;
        &lt;th class=&quot;bsEdge&quot; style=&quot;background-color: white; background-image: url(&amp;quot;/images/compatible_edge.gif&amp;quot;); background-position: 50% 50%; background-repeat: no-repeat; border: 1px solid rgb(212, 212, 212); box-sizing: inherit; color: #555555; font-weight: normal; height: 44px; padding: 11px 5px; vertical-align: middle; width: 152.8px;&quot; title=&quot;Internet Explorer / Edge&quot;&gt;
          &lt;br /&gt;
        &lt;/th&gt;
        &lt;th class=&quot;bsFirefox&quot; style=&quot;background-color: white; background-image: url(&amp;quot;/images/compatible_firefox.png&amp;quot;); background-position: 50% 50%; background-repeat: no-repeat; border: 1px solid rgb(212, 212, 212); box-sizing: inherit; color: #555555; font-weight: normal; height: 44px; padding: 11px 5px; vertical-align: middle; width: 152.8px;&quot; title=&quot;Firefox&quot;&gt;
          &lt;br /&gt;
        &lt;/th&gt;
        &lt;th class=&quot;bsSafari&quot; style=&quot;background-color: white; background-image: url(&amp;quot;/images/compatible_safari.gif&amp;quot;); background-position: 50% 50%; background-repeat: no-repeat; border: 1px solid rgb(212, 212, 212); box-sizing: inherit; color: #555555; font-weight: normal; height: 44px; padding: 11px 5px; vertical-align: middle; width: 152px;&quot; title=&quot;Safari&quot;&gt;
          &lt;br /&gt;
        &lt;/th&gt;
        &lt;th class=&quot;bsOpera&quot; style=&quot;background-color: white; background-image: url(&amp;quot;/images/compatible_opera.gif&amp;quot;); background-position: 50% 50%; background-repeat: no-repeat; border: 1px solid rgb(212, 212, 212); box-sizing: inherit; color: #555555; font-weight: normal; height: 44px; padding: 11px 5px; vertical-align: middle; width: 152px;&quot; title=&quot;Opera&quot;&gt;
          &lt;br /&gt;
        &lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody style=&quot;box-sizing: inherit;&quot;&gt;
      &lt;tr style=&quot;background-color: #f1f1f1; box-sizing: inherit;&quot;&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;transform&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;36.0
          &lt;br style=&quot;box-sizing: inherit;&quot; /&gt;
        &lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;10.0
          &lt;br style=&quot;box-sizing: inherit;&quot; /&gt;
        &lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;16.0
          &lt;br style=&quot;box-sizing: inherit;&quot; /&gt;
        &lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;9.0
          &lt;br style=&quot;box-sizing: inherit;&quot; /&gt;
        &lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;23.0
          &lt;br style=&quot;box-sizing: inherit;&quot; /&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;hr style=&quot;-webkit-text-stroke-width: 0px; background-color: white; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 0px; border-top: 1px solid rgb(238, 238, 238); box-sizing: content-box; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; height: 0px; letter-spacing: normal; margin: 20px -16px; orphans: 2; overflow: visible; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; /&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: &amp;quot;Segoe UI&amp;quot;, Arial, sans-serif; font-size: 32px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 10px 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;CSS 3D Transforms Methods&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 1.2em; margin-top: 1.2em; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;With the CSS&amp;nbsp;
  &lt;code class=&quot;w3-codespan&quot; style=&quot;background-color: #f1f1f1; box-sizing: inherit; color: crimson; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15.75px; padding-left: 4px; padding-right: 4px;&quot;&gt;transform&lt;/code&gt; property you can use the following 3D transformation methods:
&lt;/p&gt;
&lt;ul style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
  &lt;li style=&quot;box-sizing: inherit;&quot;&gt;
    &lt;code class=&quot;w3-codespan&quot; style=&quot;background-color: #f1f1f1; box-sizing: inherit; color: crimson; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15.75px; padding-left: 4px; padding-right: 4px;&quot;&gt;rotateX()&lt;/code&gt;
  &lt;/li&gt;
  &lt;li style=&quot;box-sizing: inherit;&quot;&gt;
    &lt;code class=&quot;w3-codespan&quot; style=&quot;background-color: #f1f1f1; box-sizing: inherit; color: crimson; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15.75px; padding-left: 4px; padding-right: 4px;&quot;&gt;rotateY()&lt;/code&gt;
  &lt;/li&gt;
  &lt;li style=&quot;box-sizing: inherit;&quot;&gt;
    &lt;code class=&quot;w3-codespan&quot; style=&quot;background-color: #f1f1f1; box-sizing: inherit; color: crimson; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15.75px; padding-left: 4px; padding-right: 4px;&quot;&gt;rotateZ()&lt;/code&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;hr style=&quot;-webkit-text-stroke-width: 0px; background-color: white; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 0px; border-top: 1px solid rgb(238, 238, 238); box-sizing: content-box; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; height: 0px; letter-spacing: normal; margin: 20px -16px; orphans: 2; overflow: visible; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; /&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: &amp;quot;Segoe UI&amp;quot;, Arial, sans-serif; font-size: 32px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 10px 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The rotateX() Method&lt;/h2&gt;
&lt;p&gt;
  &lt;img alt=&quot;Rotate X&quot; src=&quot;https://www.w3schools.com/css/transform_rotatex.gif&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; border-style: none; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; /&gt;
&lt;/p&gt;
&lt;p&gt;
  &lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; /&gt;
&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 1.2em; margin-top: 1.2em; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The&amp;nbsp;
  &lt;code class=&quot;w3-codespan&quot; style=&quot;background-color: #f1f1f1; box-sizing: inherit; color: crimson; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15.75px; padding-left: 4px; padding-right: 4px;&quot;&gt;rotateX()&lt;/code&gt; method rotates an element around its X-axis at a given degree:
&lt;/p&gt;
&lt;div class=&quot;w3-example&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #f1f1f1; box-shadow: none; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 24px -20px; orphans: 2; padding: 8px 20px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
  &lt;h3 style=&quot;box-sizing: inherit; font-family: &amp;quot;Segoe UI&amp;quot;, Arial, sans-serif; font-size: 24px; font-weight: 400; margin: 10px 0px;&quot;&gt;Example&lt;/h3&gt;
  &lt;div class=&quot;w3-code notranslate cssHigh&quot; style=&quot;background-color: white; border-left: 4px solid rgb(76, 175, 80); box-sizing: inherit; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15px; margin-bottom: 16px; margin-top: 16px; overflow-wrap: break-word; padding: 8px 12px; width: auto;&quot;&gt;&lt;span class=&quot;cssselectorcolor&quot; style=&quot;box-sizing: inherit; color: brown;&quot;&gt;#myDiv&amp;nbsp;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;csspropertycolor&quot; style=&quot;box-sizing: inherit; color: red;&quot;&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt; transform&lt;span class=&quot;csspropertyvaluecolor&quot; style=&quot;box-sizing: inherit; color: mediumblue;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;:&lt;/span&gt; rotateX(150deg)&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt;
      &lt;/span&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
  &lt;a class=&quot;w3-btn w3-margin-bottom&quot; href=&quot;https://www.w3schools.com/css/tryit.asp?filename=trycss3_transform_rotateX&quot; style=&quot;background-color: #4caf50; border: none; box-sizing: inherit; color: white; cursor: pointer; display: inline-block; margin-bottom: 16px; overflow: hidden; padding: 8px 16px; text-align: center; text-decoration: none; user-select: none; vertical-align: middle; white-space: nowrap;&quot; target=&quot;_blank&quot;&gt;Try it Yourself »&lt;/a&gt;
&lt;/div&gt;
&lt;hr style=&quot;-webkit-text-stroke-width: 0px; background-color: white; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 0px; border-top: 1px solid rgb(238, 238, 238); box-sizing: content-box; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; height: 0px; letter-spacing: normal; margin: 20px -16px; orphans: 2; overflow: visible; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; /&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: &amp;quot;Segoe UI&amp;quot;, Arial, sans-serif; font-size: 32px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 10px 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The rotateY() Method&lt;/h2&gt;
&lt;p&gt;
  &lt;img alt=&quot;Rotate Y&quot; src=&quot;https://www.w3schools.com/css/transform_rotatey.gif&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; border-style: none; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; /&gt;
&lt;/p&gt;
&lt;p&gt;
  &lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; /&gt;
&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 1.2em; margin-top: 1.2em; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The&amp;nbsp;
  &lt;code class=&quot;w3-codespan&quot; style=&quot;background-color: #f1f1f1; box-sizing: inherit; color: crimson; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15.75px; padding-left: 4px; padding-right: 4px;&quot;&gt;rotateY()&lt;/code&gt; method rotates an element around its Y-axis at a given degree:
&lt;/p&gt;
&lt;div class=&quot;w3-example&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #f1f1f1; box-shadow: none; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 24px -20px; orphans: 2; padding: 8px 20px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
  &lt;h3 style=&quot;box-sizing: inherit; font-family: &amp;quot;Segoe UI&amp;quot;, Arial, sans-serif; font-size: 24px; font-weight: 400; margin: 10px 0px;&quot;&gt;Example&lt;/h3&gt;
  &lt;div class=&quot;w3-code notranslate cssHigh&quot; style=&quot;background-color: white; border-left: 4px solid rgb(76, 175, 80); box-sizing: inherit; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15px; margin-bottom: 16px; margin-top: 16px; overflow-wrap: break-word; padding: 8px 12px; width: auto;&quot;&gt;&lt;span class=&quot;cssselectorcolor&quot; style=&quot;box-sizing: inherit; color: brown;&quot;&gt;#myDiv&amp;nbsp;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;csspropertycolor&quot; style=&quot;box-sizing: inherit; color: red;&quot;&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt; transform&lt;span class=&quot;csspropertyvaluecolor&quot; style=&quot;box-sizing: inherit; color: mediumblue;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;:&lt;/span&gt; rotateY(130deg)&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt;
      &lt;/span&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
  &lt;a class=&quot;w3-btn w3-margin-bottom&quot; href=&quot;https://www.w3schools.com/css/tryit.asp?filename=trycss3_transform_rotateY&quot; style=&quot;background-color: #4caf50; border: none; box-sizing: inherit; color: white; cursor: pointer; display: inline-block; margin-bottom: 16px; overflow: hidden; padding: 8px 16px; text-align: center; text-decoration: none; user-select: none; vertical-align: middle; white-space: nowrap;&quot; target=&quot;_blank&quot;&gt;Try it Yourself »&lt;/a&gt;
&lt;/div&gt;
&lt;hr style=&quot;-webkit-text-stroke-width: 0px; background-color: white; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 0px; border-top: 1px solid rgb(238, 238, 238); box-sizing: content-box; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; height: 0px; letter-spacing: normal; margin: 20px -16px; orphans: 2; overflow: visible; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; /&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: &amp;quot;Segoe UI&amp;quot;, Arial, sans-serif; font-size: 32px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 10px 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The rotateZ() Method&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 1.2em; margin-top: 1.2em; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The&amp;nbsp;
  &lt;code class=&quot;w3-codespan&quot; style=&quot;background-color: #f1f1f1; box-sizing: inherit; color: crimson; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15.75px; padding-left: 4px; padding-right: 4px;&quot;&gt;rotateZ()&lt;/code&gt; method rotates an element around its Z-axis at a given degree:
&lt;/p&gt;
&lt;div class=&quot;w3-example&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #f1f1f1; box-shadow: none; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 24px -20px; orphans: 2; padding: 8px 20px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
  &lt;h3 style=&quot;box-sizing: inherit; font-family: &amp;quot;Segoe UI&amp;quot;, Arial, sans-serif; font-size: 24px; font-weight: 400; margin: 10px 0px;&quot;&gt;Example&lt;/h3&gt;
  &lt;div class=&quot;w3-code notranslate cssHigh&quot; style=&quot;background-color: white; border-left: 4px solid rgb(76, 175, 80); box-sizing: inherit; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15px; margin-bottom: 16px; margin-top: 16px; overflow-wrap: break-word; padding: 8px 12px; width: auto;&quot;&gt;&lt;span class=&quot;cssselectorcolor&quot; style=&quot;box-sizing: inherit; color: brown;&quot;&gt;#myDiv&amp;nbsp;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;csspropertycolor&quot; style=&quot;box-sizing: inherit; color: red;&quot;&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt; transform&lt;span class=&quot;csspropertyvaluecolor&quot; style=&quot;box-sizing: inherit; color: mediumblue;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;:&lt;/span&gt; rotateZ(90deg)&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt;
      &lt;/span&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
  &lt;a class=&quot;w3-btn w3-margin-bottom&quot; href=&quot;https://www.w3schools.com/css/tryit.asp?filename=trycss3_transform_rotateZ&quot; style=&quot;background-color: #4caf50; border: none; box-sizing: inherit; color: white; cursor: pointer; display: inline-block; margin-bottom: 16px; overflow: hidden; padding: 8px 16px; text-align: center; text-decoration: none; user-select: none; vertical-align: middle; white-space: nowrap;&quot; target=&quot;_blank&quot;&gt;Try it Yourself »&lt;/a&gt;
&lt;/div&gt;
&lt;hr style=&quot;-webkit-text-stroke-width: 0px; background-color: white; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 0px; border-top: 1px solid rgb(238, 238, 238); box-sizing: content-box; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; height: 0px; letter-spacing: normal; margin: 20px -16px; orphans: 2; overflow: visible; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; /&gt;
&lt;div class=&quot;w3-container w3-dark-grey w3-padding&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #616161; box-sizing: inherit; color: white; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; padding: 8px 16px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
  &lt;h2 style=&quot;box-sizing: inherit; font-family: &amp;quot;Segoe UI&amp;quot;, Arial, sans-serif; font-size: 32px; font-weight: 400; margin: 10px 0px;&quot;&gt;Test Yourself with Exercises!&lt;/h2&gt;
  &lt;div class=&quot;w3-bar w3-margin-bottom&quot; style=&quot;box-sizing: inherit; margin-bottom: 16px; overflow: hidden; width: 985.662px;&quot;&gt;
    &lt;a class=&quot;w3-bar-item w3-btn&quot; href=&quot;https://www.w3schools.com/css/exercise.asp?filename=exercise_css3_3dtransforms1&quot; style=&quot;background-color: #4caf50; border: none; box-sizing: inherit; color: white; cursor: pointer; display: block; float: left; margin: 10px 5px 0px 0px; outline: 0px; overflow: hidden; padding: 8px 16px; text-align: center; text-decoration: none; user-select: none; vertical-align: middle; white-space: nowrap; width: auto;&quot; target=&quot;_blank&quot;&gt;Exercise 1 »&lt;/a&gt;
    &lt;a class=&quot;w3-bar-item w3-btn&quot; href=&quot;https://www.w3schools.com/css/exercise.asp?filename=exercise_css3_3dtransforms2&quot; style=&quot;background-color: #4caf50; border: none; box-sizing: inherit; color: white; cursor: pointer; display: block; float: left; margin: 10px 5px 0px 0px; outline: 0px; overflow: hidden; padding: 8px 16px; text-align: center; text-decoration: none; user-select: none; vertical-align: middle; white-space: nowrap; width: auto;&quot; target=&quot;_blank&quot;&gt;Exercise 2 »&lt;/a&gt;
    &lt;a class=&quot;w3-bar-item w3-btn&quot; href=&quot;https://www.w3schools.com/css/exercise.asp?filename=exercise_css3_3dtransforms3&quot; style=&quot;background-color: #4caf50; border: none; box-sizing: inherit; color: white; cursor: pointer; display: block; float: left; margin: 10px 5px 0px 0px; outline: 0px; overflow: hidden; padding: 8px 16px; text-align: center; text-decoration: none; user-select: none; vertical-align: middle; white-space: nowrap; width: auto;&quot; target=&quot;_blank&quot;&gt;Exercise 3 »&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;hr style=&quot;-webkit-text-stroke-width: 0px; background-color: white; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 0px; border-top: 1px solid rgb(238, 238, 238); box-sizing: content-box; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; height: 0px; letter-spacing: normal; margin: 20px -16px; orphans: 2; overflow: visible; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; /&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: &amp;quot;Segoe UI&amp;quot;, Arial, sans-serif; font-size: 32px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 10px 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;CSS Transform Properties&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 1.2em; margin-top: 1.2em; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The following table lists all the 3D transform properties:&lt;/p&gt;
&lt;table class=&quot;w3-table-all notranslate&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; border-collapse: collapse; border-spacing: 0px; border: 1px solid rgb(204, 204, 204); box-sizing: inherit; color: black; display: table; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 20px 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; width: 1017.6px; word-spacing: 0px;&quot;&gt;
  &lt;thead&gt;
    &lt;tr style=&quot;background-color: white; border-bottom: 1px solid rgb(221, 221, 221); box-sizing: inherit;&quot;&gt;
      &lt;th style=&quot;box-sizing: inherit; display: table-cell; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top; width: 223.2px;&quot;&gt;Property&lt;/th&gt;
      &lt;th style=&quot;box-sizing: inherit; display: table-cell; padding: 8px; text-align: left; vertical-align: top;&quot;&gt;Description&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody style=&quot;box-sizing: inherit;&quot;&gt;
    &lt;tr style=&quot;background-color: #f1f1f1; border-bottom: 1px solid rgb(221, 221, 221); box-sizing: inherit;&quot;&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;
        &lt;a href=&quot;https://www.w3schools.com/cssref/css3_pr_transform.asp&quot; style=&quot;background-color: transparent; box-sizing: inherit; color: inherit;&quot;&gt;transform&lt;/a&gt;
      &lt;/td&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px; text-align: left; vertical-align: top;&quot;&gt;Applies a 2D or 3D transformation to an element&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr style=&quot;background-color: white; border-bottom: 1px solid rgb(221, 221, 221); box-sizing: inherit;&quot;&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;
        &lt;a href=&quot;https://www.w3schools.com/cssref/css3_pr_transform-origin.asp&quot; style=&quot;background-color: transparent; box-sizing: inherit; color: inherit;&quot;&gt;transform-origin&lt;/a&gt;
      &lt;/td&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px; text-align: left; vertical-align: top;&quot;&gt;Allows you to change the position on transformed elements&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr style=&quot;background-color: #f1f1f1; border-bottom: 1px solid rgb(221, 221, 221); box-sizing: inherit;&quot;&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;
        &lt;a href=&quot;https://www.w3schools.com/cssref/css3_pr_transform-style.asp&quot; style=&quot;background-color: transparent; box-sizing: inherit; color: inherit;&quot;&gt;transform-style&lt;/a&gt;
      &lt;/td&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px; text-align: left; vertical-align: top;&quot;&gt;Specifies how nested elements are rendered in 3D space&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr style=&quot;background-color: white; border-bottom: 1px solid rgb(221, 221, 221); box-sizing: inherit;&quot;&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;
        &lt;a href=&quot;https://www.w3schools.com/cssref/css3_pr_perspective.asp&quot; style=&quot;background-color: transparent; box-sizing: inherit; color: inherit;&quot;&gt;perspective&lt;/a&gt;
      &lt;/td&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px; text-align: left; vertical-align: top;&quot;&gt;Specifies the perspective on how 3D elements are viewed&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr style=&quot;background-color: #f1f1f1; border-bottom: 1px solid rgb(221, 221, 221); box-sizing: inherit;&quot;&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;
        &lt;a href=&quot;https://www.w3schools.com/cssref/css3_pr_perspective-origin.asp&quot; style=&quot;background-color: transparent; box-sizing: inherit; color: inherit;&quot;&gt;perspective-origin&lt;/a&gt;
      &lt;/td&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px; text-align: left; vertical-align: top;&quot;&gt;Specifies the bottom position of 3D elements&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr style=&quot;background-color: white; border-bottom: 1px solid rgb(221, 221, 221); box-sizing: inherit;&quot;&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;
        &lt;a href=&quot;https://www.w3schools.com/cssref/css3_pr_backface-visibility.asp&quot; style=&quot;background-color: transparent; box-sizing: inherit; color: inherit;&quot;&gt;backface-visibility&lt;/a&gt;
      &lt;/td&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px; text-align: left; vertical-align: top;&quot;&gt;Defines whether or not an element should be visible when not facing the screen&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: &amp;quot;Segoe UI&amp;quot;, Arial, sans-serif; font-size: 32px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 10px 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;CSS 3D Transform Methods&lt;/h2&gt;
&lt;table class=&quot;w3-table-all notranslate&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; border-collapse: collapse; border-spacing: 0px; border: 1px solid rgb(204, 204, 204); box-sizing: inherit; color: black; display: table; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 20px 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; width: 1017.6px; word-spacing: 0px;&quot;&gt;
  &lt;thead&gt;
    &lt;tr style=&quot;background-color: white; border-bottom: 1px solid rgb(221, 221, 221); box-sizing: inherit;&quot;&gt;
      &lt;th style=&quot;box-sizing: inherit; display: table-cell; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top; width: 272.8px;&quot;&gt;Function&lt;/th&gt;
      &lt;th style=&quot;box-sizing: inherit; display: table-cell; padding: 8px; text-align: left; vertical-align: top;&quot;&gt;Description&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody style=&quot;box-sizing: inherit;&quot;&gt;
    &lt;tr style=&quot;background-color: #f1f1f1; border-bottom: 1px solid rgb(221, 221, 221); box-sizing: inherit;&quot;&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;matrix3d
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt;(
        &lt;i style=&quot;box-sizing: inherit;&quot;&gt;n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n&lt;/i&gt;)
      &lt;/td&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px; text-align: left; vertical-align: top;&quot;&gt;Defines a 3D transformation, using a 4x4 matrix of 16 values&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr style=&quot;background-color: white; border-bottom: 1px solid rgb(221, 221, 221); box-sizing: inherit;&quot;&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;translate3d(
        &lt;i style=&quot;box-sizing: inherit;&quot;&gt;x,y,z&lt;/i&gt;)
      &lt;/td&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px; text-align: left; vertical-align: top;&quot;&gt;Defines a 3D translation&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr style=&quot;background-color: #f1f1f1; border-bottom: 1px solid rgb(221, 221, 221); box-sizing: inherit;&quot;&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;translateX(
        &lt;i style=&quot;box-sizing: inherit;&quot;&gt;x&lt;/i&gt;)
      &lt;/td&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px; text-align: left; vertical-align: top;&quot;&gt;Defines a 3D translation, using only the value for the X-axis&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr style=&quot;background-color: white; border-bottom: 1px solid rgb(221, 221, 221); box-sizing: inherit;&quot;&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;translateY(
        &lt;i style=&quot;box-sizing: inherit;&quot;&gt;y&lt;/i&gt;)
      &lt;/td&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px; text-align: left; vertical-align: top;&quot;&gt;Defines a 3D translation, using only the value for the Y-axis&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr style=&quot;background-color: #f1f1f1; border-bottom: 1px solid rgb(221, 221, 221); box-sizing: inherit;&quot;&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;translateZ(
        &lt;i style=&quot;box-sizing: inherit;&quot;&gt;z&lt;/i&gt;)
      &lt;/td&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px; text-align: left; vertical-align: top;&quot;&gt;Defines a 3D translation, using only the value for the Z-axis&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr style=&quot;background-color: white; border-bottom: 1px solid rgb(221, 221, 221); box-sizing: inherit;&quot;&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;scale3d(
        &lt;i style=&quot;box-sizing: inherit;&quot;&gt;x,y,z&lt;/i&gt;)
      &lt;/td&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px; text-align: left; vertical-align: top;&quot;&gt;Defines a 3D scale transformation&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr style=&quot;background-color: #f1f1f1; border-bottom: 1px solid rgb(221, 221, 221); box-sizing: inherit;&quot;&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;scaleX(
        &lt;i style=&quot;box-sizing: inherit;&quot;&gt;x&lt;/i&gt;)
      &lt;/td&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px; text-align: left; vertical-align: top;&quot;&gt;Defines a 3D scale transformation by giving a value for the X-axis&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr style=&quot;background-color: white; border-bottom: 1px solid rgb(221, 221, 221); box-sizing: inherit;&quot;&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;scaleY(
        &lt;i style=&quot;box-sizing: inherit;&quot;&gt;y&lt;/i&gt;)
      &lt;/td&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px; text-align: left; vertical-align: top;&quot;&gt;Defines a 3D scale transformation by giving a value for the Y-axis&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr style=&quot;background-color: #f1f1f1; border-bottom: 1px solid rgb(221, 221, 221); box-sizing: inherit;&quot;&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;scaleZ(
        &lt;i style=&quot;box-sizing: inherit;&quot;&gt;z&lt;/i&gt;)
      &lt;/td&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px; text-align: left; vertical-align: top;&quot;&gt;Defines a 3D scale transformation by giving a value for the Z-axis&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr style=&quot;background-color: white; border-bottom: 1px solid rgb(221, 221, 221); box-sizing: inherit;&quot;&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;rotate3d(
        &lt;i style=&quot;box-sizing: inherit;&quot;&gt;x,y,z,angle&lt;/i&gt;)
      &lt;/td&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px; text-align: left; vertical-align: top;&quot;&gt;Defines a 3D rotation&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr style=&quot;background-color: #f1f1f1; border-bottom: 1px solid rgb(221, 221, 221); box-sizing: inherit;&quot;&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;rotateX(
        &lt;i style=&quot;box-sizing: inherit;&quot;&gt;angle&lt;/i&gt;)
      &lt;/td&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px; text-align: left; vertical-align: top;&quot;&gt;Defines a 3D rotation along the X-axis&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr style=&quot;background-color: white; border-bottom: 1px solid rgb(221, 221, 221); box-sizing: inherit;&quot;&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;rotateY(
        &lt;i style=&quot;box-sizing: inherit;&quot;&gt;angle&lt;/i&gt;)
      &lt;/td&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px; text-align: left; vertical-align: top;&quot;&gt;Defines a 3D rotation along the Y-axis&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr style=&quot;background-color: #f1f1f1; border-bottom: 1px solid rgb(221, 221, 221); box-sizing: inherit;&quot;&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;rotateZ(
        &lt;i style=&quot;box-sizing: inherit;&quot;&gt;angle&lt;/i&gt;)
      &lt;/td&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px; text-align: left; vertical-align: top;&quot;&gt;Defines a 3D rotation along the Z-axis&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr style=&quot;background-color: white; border-bottom: 1px solid rgb(221, 221, 221); box-sizing: inherit;&quot;&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;perspective(
        &lt;i style=&quot;box-sizing: inherit;&quot;&gt;n&lt;/i&gt;)
      &lt;/td&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px; text-align: left; vertical-align: top;&quot;&gt;Defines a perspective view for a 3D transformed element&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;
&lt;table class=&quot;w3-table-all notranslate&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; border-collapse: collapse; border-spacing: 0px; border: 1px solid rgb(204, 204, 204); box-sizing: inherit; color: black; display: table; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 20px 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; width: 1017.6px; word-spacing: 0px;&quot;&gt;
  &lt;tbody style=&quot;box-sizing: inherit;&quot;&gt;
    &lt;tr style=&quot;background-color: white; border-bottom: 1px solid rgb(221, 221, 221); box-sizing: inherit;&quot;&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;
        &lt;br /&gt;
      &lt;/td&gt;
      &lt;td style=&quot;box-sizing: inherit; display: table-cell; padding: 8px; text-align: left; vertical-align: top;&quot;&gt;
        &lt;br /&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h1&gt;Animation&lt;/h1&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: &amp;quot;Segoe UI&amp;quot;, Arial, sans-serif; font-size: 32px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 10px 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;CSS Animations&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 1.2em; margin-top: 1.2em; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;CSS allows animation of HTML elements without using JavaScript or Flash!&lt;/p&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; animation: 5s ease 0s 1 normal none running animated_div; background: rgb(146, 185, 1); border-radius: 5px; box-sizing: inherit; color: white; font-family: Verdana, sans-serif; font-size: 20px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: bold; height: 47px; letter-spacing: normal; orphans: 2; padding: 10px; position: relative; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; width: 70px; word-spacing: 0px;&quot;&gt;CSS&lt;/div&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 1.2em; margin-top: 1.2em; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;In this chapter you will learn about the following properties:&lt;/p&gt;
&lt;ul style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
  &lt;li style=&quot;box-sizing: inherit;&quot;&gt;
    &lt;code class=&quot;w3-codespan&quot; style=&quot;background-color: #f1f1f1; box-sizing: inherit; color: crimson; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15.75px; padding-left: 4px; padding-right: 4px;&quot;&gt;@keyframes&lt;/code&gt;
  &lt;/li&gt;
  &lt;li style=&quot;box-sizing: inherit;&quot;&gt;
    &lt;code class=&quot;w3-codespan&quot; style=&quot;background-color: #f1f1f1; box-sizing: inherit; color: crimson; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15.75px; padding-left: 4px; padding-right: 4px;&quot;&gt;animation-name&lt;/code&gt;
  &lt;/li&gt;
  &lt;li style=&quot;box-sizing: inherit;&quot;&gt;
    &lt;code class=&quot;w3-codespan&quot; style=&quot;background-color: #f1f1f1; box-sizing: inherit; color: crimson; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15.75px; padding-left: 4px; padding-right: 4px;&quot;&gt;animation-duration&lt;/code&gt;
  &lt;/li&gt;
  &lt;li style=&quot;box-sizing: inherit;&quot;&gt;
    &lt;code class=&quot;w3-codespan&quot; style=&quot;background-color: #f1f1f1; box-sizing: inherit; color: crimson; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15.75px; padding-left: 4px; padding-right: 4px;&quot;&gt;animation-delay&lt;/code&gt;
  &lt;/li&gt;
  &lt;li style=&quot;box-sizing: inherit;&quot;&gt;
    &lt;code class=&quot;w3-codespan&quot; style=&quot;background-color: #f1f1f1; box-sizing: inherit; color: crimson; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15.75px; padding-left: 4px; padding-right: 4px;&quot;&gt;animation-iteration-count&lt;/code&gt;
  &lt;/li&gt;
  &lt;li style=&quot;box-sizing: inherit;&quot;&gt;
    &lt;code class=&quot;w3-codespan&quot; style=&quot;background-color: #f1f1f1; box-sizing: inherit; color: crimson; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15.75px; padding-left: 4px; padding-right: 4px;&quot;&gt;animation-direction&lt;/code&gt;
  &lt;/li&gt;
  &lt;li style=&quot;box-sizing: inherit;&quot;&gt;
    &lt;code class=&quot;w3-codespan&quot; style=&quot;background-color: #f1f1f1; box-sizing: inherit; color: crimson; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15.75px; padding-left: 4px; padding-right: 4px;&quot;&gt;animation-timing-function&lt;/code&gt;
  &lt;/li&gt;
  &lt;li style=&quot;box-sizing: inherit;&quot;&gt;
    &lt;code class=&quot;w3-codespan&quot; style=&quot;background-color: #f1f1f1; box-sizing: inherit; color: crimson; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15.75px; padding-left: 4px; padding-right: 4px;&quot;&gt;animation-fill-mode&lt;/code&gt;
  &lt;/li&gt;
  &lt;li style=&quot;box-sizing: inherit;&quot;&gt;
    &lt;code class=&quot;w3-codespan&quot; style=&quot;background-color: #f1f1f1; box-sizing: inherit; color: crimson; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15.75px; padding-left: 4px; padding-right: 4px;&quot;&gt;animation&lt;/code&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;hr style=&quot;-webkit-text-stroke-width: 0px; background-color: white; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 0px; border-top: 1px solid rgb(238, 238, 238); box-sizing: content-box; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; height: 0px; letter-spacing: normal; margin: 20px -16px; orphans: 2; overflow: visible; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; /&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: &amp;quot;Segoe UI&amp;quot;, Arial, sans-serif; font-size: 32px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 10px 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Browser Support for Animations&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 1.2em; margin-top: 1.2em; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The numbers in the table specify the first browser version that fully supports the property.&lt;/p&gt;
&lt;div class=&quot;w3-responsive&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; display: block; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-x: auto; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
  &lt;table class=&quot;browserref notranslate&quot; style=&quot;border-collapse: collapse; box-sizing: inherit; width: 1017.6px;&quot;&gt;
    &lt;thead&gt;
      &lt;tr style=&quot;background-color: white; box-sizing: inherit;&quot;&gt;
        &lt;th style=&quot;background-color: white; background-position: 50% 50%; background-repeat: no-repeat; border: 1px solid rgb(212, 212, 212); box-sizing: inherit; color: #555555; font-size: 16px; font-weight: normal; height: 44px; padding: 11px 5px 11px 16px; text-align: left; vertical-align: middle; width: 254.4px;&quot;&gt;Property&lt;/th&gt;
        &lt;th class=&quot;bsChrome&quot; style=&quot;background-color: white; background-image: url(&amp;quot;/images/compatible_chrome.gif&amp;quot;); background-position: 50% 50%; background-repeat: no-repeat; border: 1px solid rgb(212, 212, 212); box-sizing: inherit; color: #555555; font-weight: normal; height: 44px; padding: 11px 5px; vertical-align: middle; width: 152.8px;&quot; title=&quot;Chrome&quot;&gt;
          &lt;br /&gt;
        &lt;/th&gt;
        &lt;th class=&quot;bsEdge&quot; style=&quot;background-color: white; background-image: url(&amp;quot;/images/compatible_edge.gif&amp;quot;); background-position: 50% 50%; background-repeat: no-repeat; border: 1px solid rgb(212, 212, 212); box-sizing: inherit; color: #555555; font-weight: normal; height: 44px; padding: 11px 5px; vertical-align: middle; width: 152.8px;&quot; title=&quot;Internet Explorer / Edge&quot;&gt;
          &lt;br /&gt;
        &lt;/th&gt;
        &lt;th class=&quot;bsFirefox&quot; style=&quot;background-color: white; background-image: url(&amp;quot;/images/compatible_firefox.png&amp;quot;); background-position: 50% 50%; background-repeat: no-repeat; border: 1px solid rgb(212, 212, 212); box-sizing: inherit; color: #555555; font-weight: normal; height: 44px; padding: 11px 5px; vertical-align: middle; width: 152.8px;&quot; title=&quot;Firefox&quot;&gt;
          &lt;br /&gt;
        &lt;/th&gt;
        &lt;th class=&quot;bsSafari&quot; style=&quot;background-color: white; background-image: url(&amp;quot;/images/compatible_safari.gif&amp;quot;); background-position: 50% 50%; background-repeat: no-repeat; border: 1px solid rgb(212, 212, 212); box-sizing: inherit; color: #555555; font-weight: normal; height: 44px; padding: 11px 5px; vertical-align: middle; width: 152px;&quot; title=&quot;Safari&quot;&gt;
          &lt;br /&gt;
        &lt;/th&gt;
        &lt;th class=&quot;bsOpera&quot; style=&quot;background-color: white; background-image: url(&amp;quot;/images/compatible_opera.gif&amp;quot;); background-position: 50% 50%; background-repeat: no-repeat; border: 1px solid rgb(212, 212, 212); box-sizing: inherit; color: #555555; font-weight: normal; height: 44px; padding: 11px 5px; vertical-align: middle; width: 152px;&quot; title=&quot;Opera&quot;&gt;
          &lt;br /&gt;
        &lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody style=&quot;box-sizing: inherit;&quot;&gt;
      &lt;tr style=&quot;background-color: #f1f1f1; box-sizing: inherit;&quot;&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;@keyframes&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;43.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;10.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;16.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;9.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;30.0&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr style=&quot;background-color: white; box-sizing: inherit;&quot;&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;animation-name&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;43.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;10.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;16.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;9.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;30.0&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr style=&quot;background-color: #f1f1f1; box-sizing: inherit;&quot;&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;animation-duration&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;43.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;10.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;16.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;9.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;30.0&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr style=&quot;background-color: white; box-sizing: inherit;&quot;&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;animation-delay&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;43.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;10.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;16.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;9.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;30.0&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr style=&quot;background-color: #f1f1f1; box-sizing: inherit;&quot;&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;animation-iteration-count&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;43.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;10.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;16.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;9.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;30.0&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr style=&quot;background-color: white; box-sizing: inherit;&quot;&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;animation-direction&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;43.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;10.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;16.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;9.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;30.0&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr style=&quot;background-color: #f1f1f1; box-sizing: inherit;&quot;&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;animation-timing-function&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;43.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;10.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;16.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;9.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;30.0&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr style=&quot;background-color: white; box-sizing: inherit;&quot;&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;animation-fill-mode&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;43.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;10.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;16.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;9.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;30.0&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr style=&quot;background-color: #f1f1f1; box-sizing: inherit;&quot;&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px 8px 8px 16px; text-align: left; vertical-align: top;&quot;&gt;animation&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;43.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;10.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;16.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;9.0&lt;/td&gt;
        &lt;td style=&quot;border: 1px solid rgb(212, 212, 212); box-sizing: inherit; padding: 8px; text-align: center; vertical-align: top;&quot;&gt;30.0&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;hr style=&quot;-webkit-text-stroke-width: 0px; background-color: white; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 0px; border-top: 1px solid rgb(238, 238, 238); box-sizing: content-box; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; height: 0px; letter-spacing: normal; margin: 20px -16px; orphans: 2; overflow: visible; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; /&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: &amp;quot;Segoe UI&amp;quot;, Arial, sans-serif; font-size: 32px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 10px 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Browser Specific Prefixes&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 1.2em; margin-top: 1.2em; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Some older browsers need specific prefixes (-webkit-) to understand the animation properties:&lt;/p&gt;
&lt;div class=&quot;w3-example&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #f1f1f1; box-shadow: none; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 24px -20px; orphans: 2; padding: 8px 20px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
  &lt;h3 style=&quot;box-sizing: inherit; font-family: &amp;quot;Segoe UI&amp;quot;, Arial, sans-serif; font-size: 24px; font-weight: 400; margin: 10px 0px;&quot;&gt;Example&lt;/h3&gt;
  &lt;div class=&quot;w3-code notranslate cssHigh&quot; style=&quot;background-color: white; border-left: 4px solid rgb(76, 175, 80); box-sizing: inherit; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15px; margin-bottom: 16px; margin-top: 16px; overflow-wrap: break-word; padding: 8px 12px; width: auto;&quot;&gt;&lt;span class=&quot;cssselectorcolor&quot; style=&quot;box-sizing: inherit; color: brown;&quot;&gt;div&amp;nbsp;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;csspropertycolor&quot; style=&quot;box-sizing: inherit; color: red;&quot;&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt; width&lt;span class=&quot;csspropertyvaluecolor&quot; style=&quot;box-sizing: inherit; color: mediumblue;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;:&lt;/span&gt; 100px&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt; height&lt;span class=&quot;csspropertyvaluecolor&quot; style=&quot;box-sizing: inherit; color: mediumblue;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;:&lt;/span&gt; 100px&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt; background-color&lt;span class=&quot;csspropertyvaluecolor&quot; style=&quot;box-sizing: inherit; color: mediumblue;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;:&lt;/span&gt; red&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt; animation-name&lt;span class=&quot;csspropertyvaluecolor&quot; style=&quot;box-sizing: inherit; color: mediumblue;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;:&lt;/span&gt; example&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt; animation-duration&lt;span class=&quot;csspropertyvaluecolor&quot; style=&quot;box-sizing: inherit; color: mediumblue;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;:&lt;/span&gt; 4s&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt;
      &lt;/span&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;}&lt;/span&gt;
      &lt;br style=&quot;box-sizing: inherit;&quot; /&gt;
      &lt;br style=&quot;box-sizing: inherit;&quot; /&gt;@keyframes example&amp;nbsp;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;cssselectorcolor&quot; style=&quot;box-sizing: inherit; color: brown;&quot;&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt; from&amp;nbsp;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;csspropertycolor&quot; style=&quot;box-sizing: inherit; color: red;&quot;&gt;background-color&lt;span class=&quot;csspropertyvaluecolor&quot; style=&quot;box-sizing: inherit; color: mediumblue;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;:&lt;/span&gt; red&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt; to&amp;nbsp;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;csspropertycolor&quot; style=&quot;box-sizing: inherit; color: red;&quot;&gt;background-color&lt;span class=&quot;csspropertyvaluecolor&quot; style=&quot;box-sizing: inherit; color: mediumblue;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;:&lt;/span&gt; yellow&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt;
      &lt;/span&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
  &lt;a class=&quot;w3-btn w3-margin-bottom&quot; href=&quot;https://www.w3schools.com/css/tryit.asp?filename=trycss3_animation1&quot; style=&quot;background-color: #4caf50; border: none; box-sizing: inherit; color: white; cursor: pointer; display: inline-block; margin-bottom: 16px; overflow: hidden; padding: 8px 16px; text-align: center; text-decoration: none; user-select: none; vertical-align: middle; white-space: nowrap;&quot; target=&quot;_blank&quot;&gt;Try it Yourself »&lt;/a&gt;
&lt;/div&gt;
&lt;hr style=&quot;-webkit-text-stroke-width: 0px; background-color: white; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 0px; border-top: 1px solid rgb(238, 238, 238); box-sizing: content-box; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; height: 0px; letter-spacing: normal; margin: 20px -16px; orphans: 2; overflow: visible; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; /&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: &amp;quot;Segoe UI&amp;quot;, Arial, sans-serif; font-size: 32px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 10px 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;What are CSS Animations?&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 1.2em; margin-top: 1.2em; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;An animation lets an element gradually change from one style to another.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 1.2em; margin-top: 1.2em; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;You can change as many CSS properties you want, as many times you want.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 1.2em; margin-top: 1.2em; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;To use CSS animation, you must first specify some keyframes for the animation.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 1.2em; margin-top: 1.2em; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Keyframes hold what styles the element will have at certain times.&lt;/p&gt;
&lt;hr style=&quot;-webkit-text-stroke-width: 0px; background-color: white; border-bottom: 0px; border-image: initial; border-left: 0px; border-right: 0px; border-top: 1px solid rgb(238, 238, 238); box-sizing: content-box; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; height: 0px; letter-spacing: normal; margin: 20px -16px; orphans: 2; overflow: visible; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; /&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: &amp;quot;Segoe UI&amp;quot;, Arial, sans-serif; font-size: 32px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 10px 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The @keyframes Rule&lt;/h2&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 1.2em; margin-top: 1.2em; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;When you specify CSS styles inside the&amp;nbsp;
  &lt;code class=&quot;w3-codespan&quot; style=&quot;background-color: #f1f1f1; box-sizing: inherit; color: crimson; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15.75px; padding-left: 4px; padding-right: 4px;&quot;&gt;@keyframes&lt;/code&gt; rule, the animation will gradually change from the current style to the new style at certain times.
&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 1.2em; margin-top: 1.2em; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;To get an animation to work, you must bind the animation to an element.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 1.2em; margin-top: 1.2em; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The following example binds the &quot;example&quot; animation to the &amp;lt;div&amp;gt; element. The animation will last for 4 seconds, and it will gradually change the background-color of the &amp;lt;div&amp;gt; element from &quot;red&quot; to &quot;yellow&quot;:&lt;/p&gt;
&lt;div class=&quot;w3-example&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #f1f1f1; box-shadow: none; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 24px -20px; orphans: 2; padding: 8px 20px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
  &lt;h3 style=&quot;box-sizing: inherit; font-family: &amp;quot;Segoe UI&amp;quot;, Arial, sans-serif; font-size: 24px; font-weight: 400; margin: 10px 0px;&quot;&gt;Example&lt;/h3&gt;
  &lt;div class=&quot;w3-code notranslate cssHigh&quot; style=&quot;background-color: white; border-left: 4px solid rgb(76, 175, 80); box-sizing: inherit; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15px; margin-bottom: 16px; margin-top: 16px; overflow-wrap: break-word; padding: 8px 12px; width: auto;&quot;&gt;&lt;span class=&quot;cssselectorcolor&quot; style=&quot;box-sizing: inherit; color: brown;&quot;&gt;&lt;span class=&quot;commentcolor&quot; style=&quot;box-sizing: inherit; color: green;&quot;&gt;/* The animation code */&lt;/span&gt;
      &lt;br style=&quot;box-sizing: inherit;&quot; /&gt;@keyframes example&amp;nbsp;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;cssselectorcolor&quot; style=&quot;box-sizing: inherit; color: brown;&quot;&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt; from&amp;nbsp;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;csspropertycolor&quot; style=&quot;box-sizing: inherit; color: red;&quot;&gt;background-color&lt;span class=&quot;csspropertyvaluecolor&quot; style=&quot;box-sizing: inherit; color: mediumblue;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;:&lt;/span&gt; red&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt; to&amp;nbsp;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;csspropertycolor&quot; style=&quot;box-sizing: inherit; color: red;&quot;&gt;background-color&lt;span class=&quot;csspropertyvaluecolor&quot; style=&quot;box-sizing: inherit; color: mediumblue;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;:&lt;/span&gt; yellow&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt;
      &lt;/span&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;}&lt;/span&gt;
      &lt;br style=&quot;box-sizing: inherit;&quot; /&gt;
      &lt;br style=&quot;box-sizing: inherit;&quot; /&gt;&lt;span class=&quot;commentcolor&quot; style=&quot;box-sizing: inherit; color: green;&quot;&gt;/* The element to apply the animation to */&lt;/span&gt;
      &lt;br style=&quot;box-sizing: inherit;&quot; /&gt;div&amp;nbsp;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;csspropertycolor&quot; style=&quot;box-sizing: inherit; color: red;&quot;&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt; width&lt;span class=&quot;csspropertyvaluecolor&quot; style=&quot;box-sizing: inherit; color: mediumblue;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;:&lt;/span&gt; 100px&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt; height&lt;span class=&quot;csspropertyvaluecolor&quot; style=&quot;box-sizing: inherit; color: mediumblue;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;:&lt;/span&gt; 100px&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt; background-color&lt;span class=&quot;csspropertyvaluecolor&quot; style=&quot;box-sizing: inherit; color: mediumblue;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;:&lt;/span&gt; red&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt; animation-name&lt;span class=&quot;csspropertyvaluecolor&quot; style=&quot;box-sizing: inherit; color: mediumblue;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;:&lt;/span&gt; example&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt; animation-duration&lt;span class=&quot;csspropertyvaluecolor&quot; style=&quot;box-sizing: inherit; color: mediumblue;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;:&lt;/span&gt; 4s&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt;
      &lt;/span&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
  &lt;a class=&quot;w3-btn w3-margin-bottom&quot; href=&quot;https://www.w3schools.com/css/tryit.asp?filename=trycss3_animation1&quot; style=&quot;background-color: #4caf50; border: none; box-sizing: inherit; color: white; cursor: pointer; display: inline-block; margin-bottom: 16px; overflow: hidden; padding: 8px 16px; text-align: center; text-decoration: none; user-select: none; vertical-align: middle; white-space: nowrap;&quot; target=&quot;_blank&quot;&gt;Try it Yourself »&lt;/a&gt;
&lt;/div&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 1.2em; margin-top: 1.2em; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
  &lt;b style=&quot;box-sizing: inherit; font-weight: bolder;&quot;&gt;Note:&lt;/b&gt; The&amp;nbsp;
  &lt;code class=&quot;w3-codespan&quot; style=&quot;background-color: #f1f1f1; box-sizing: inherit; color: crimson; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15.75px; padding-left: 4px; padding-right: 4px;&quot;&gt;animation-duration&lt;/code&gt; property defines how long time an animation should take to complete. If the&amp;nbsp;
  &lt;code class=&quot;w3-codespan&quot; style=&quot;background-color: #f1f1f1; box-sizing: inherit; color: crimson; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15.75px; padding-left: 4px; padding-right: 4px;&quot;&gt;animation-duration&lt;/code&gt; property is not specified, no animation will occur, because the default value is 0s (0 seconds).&amp;nbsp;
&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 1.2em; margin-top: 1.2em; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;In the example above we have specified when the style will change by using the keywords &quot;from&quot; and &quot;to&quot; (which represents 0% (start) and 100% (complete)).&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 1.2em; margin-top: 1.2em; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;It is also possible to use percent. By using percent, you can add as many style changes as you like.&lt;/p&gt;
&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-bottom: 1.2em; margin-top: 1.2em; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;The following example will change the background-color of the &amp;lt;div&amp;gt; element when the animation is 25% complete, 50% complete, and again when the animation is 100% complete:&lt;/p&gt;
&lt;div class=&quot;w3-example&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #f1f1f1; box-shadow: none; box-sizing: inherit; color: black; font-family: Verdana, sans-serif; font-size: 15px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 24px -20px; orphans: 2; padding: 8px 20px; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
  &lt;h3 style=&quot;box-sizing: inherit; font-family: &amp;quot;Segoe UI&amp;quot;, Arial, sans-serif; font-size: 24px; font-weight: 400; margin: 10px 0px;&quot;&gt;Example&lt;/h3&gt;
  &lt;div class=&quot;w3-code notranslate cssHigh&quot; style=&quot;background-color: white; border-left: 4px solid rgb(76, 175, 80); box-sizing: inherit; font-family: Consolas, &amp;quot;courier new&amp;quot;; font-size: 15px; margin-bottom: 16px; margin-top: 16px; overflow-wrap: break-word; padding: 8px 12px; width: auto;&quot;&gt;&lt;span class=&quot;cssselectorcolor&quot; style=&quot;box-sizing: inherit; color: brown;&quot;&gt;&lt;span class=&quot;commentcolor&quot; style=&quot;box-sizing: inherit; color: green;&quot;&gt;/* The animation code */&lt;/span&gt;
      &lt;br style=&quot;box-sizing: inherit;&quot; /&gt;@keyframes example&amp;nbsp;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;cssselectorcolor&quot; style=&quot;box-sizing: inherit; color: brown;&quot;&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt; 0% &amp;nbsp;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;csspropertycolor&quot; style=&quot;box-sizing: inherit; color: red;&quot;&gt;background-color&lt;span class=&quot;csspropertyvaluecolor&quot; style=&quot;box-sizing: inherit; color: mediumblue;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;:&lt;/span&gt; red&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt; 25% &amp;nbsp;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;csspropertycolor&quot; style=&quot;box-sizing: inherit; color: red;&quot;&gt;background-color&lt;span class=&quot;csspropertyvaluecolor&quot; style=&quot;box-sizing: inherit; color: mediumblue;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;:&lt;/span&gt; yellow&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt; 50% &amp;nbsp;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;csspropertycolor&quot; style=&quot;box-sizing: inherit; color: red;&quot;&gt;background-color&lt;span class=&quot;csspropertyvaluecolor&quot; style=&quot;box-sizing: inherit; color: mediumblue;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;:&lt;/span&gt; blue&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt; 100%&amp;nbsp;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;csspropertycolor&quot; style=&quot;box-sizing: inherit; color: red;&quot;&gt;background-color&lt;span class=&quot;csspropertyvaluecolor&quot; style=&quot;box-sizing: inherit; color: mediumblue;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;:&lt;/span&gt; green&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt;
      &lt;/span&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;}&lt;/span&gt;
      &lt;br style=&quot;box-sizing: inherit;&quot; /&gt;
      &lt;br style=&quot;box-sizing: inherit;&quot; /&gt;&lt;span class=&quot;commentcolor&quot; style=&quot;box-sizing: inherit; color: green;&quot;&gt;/* The element to apply the animation to */&lt;/span&gt;
      &lt;br style=&quot;box-sizing: inherit;&quot; /&gt;div&amp;nbsp;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;csspropertycolor&quot; style=&quot;box-sizing: inherit; color: red;&quot;&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt; width&lt;span class=&quot;csspropertyvaluecolor&quot; style=&quot;box-sizing: inherit; color: mediumblue;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;:&lt;/span&gt; 100px&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt; height&lt;span class=&quot;csspropertyvaluecolor&quot; style=&quot;box-sizing: inherit; color: mediumblue;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;:&lt;/span&gt; 100px&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt; background-color&lt;span class=&quot;csspropertyvaluecolor&quot; style=&quot;box-sizing: inherit; color: mediumblue;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;:&lt;/span&gt; red&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt; animation-name&lt;span class=&quot;csspropertyvaluecolor&quot; style=&quot;box-sizing: inherit; color: mediumblue;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;:&lt;/span&gt; example&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt; animation-duration&lt;span class=&quot;csspropertyvaluecolor&quot; style=&quot;box-sizing: inherit; color: mediumblue;&quot;&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;:&lt;/span&gt; 4s&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
        &lt;br style=&quot;box-sizing: inherit;&quot; /&gt;
      &lt;/span&gt;&lt;span class=&quot;cssdelimitercolor&quot; style=&quot;box-sizing: inherit; color: black;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script&gt;mbtTOC();&lt;/script&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;http://feeds.feedburner.com/PostLinkSharing&lt;/div&gt;</description><link>https://plinksharing.blogspot.com/2021/02/css-tutorials.html</link><author>noreply@blogger.com (Arakkha Sênâ)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSp2mZNIcYKdbaWCaygV8REpsbBJXJ2Huw2LCtg3XtomXaRSRKz-kLiwnHbObUlJIge93QK8Z_iLFamM3FTFN0I_crjd9NPtRntf2Hg8f0ys0fYpkCXh7BIxhJHhCsMKxf9eo9vKv_N5hz/s72-c/css-illustration.png" height="72" width="72"/><thr:total>0</thr:total></item></channel></rss>