You are on page 1of 4

Program No.

8
Objective: Write programs using javascript for web page to display browser’s
information:
Theory:- HTML tags used in this program are :

i. The <h1> to <h6> tags are used to define HTML headings.<h1> defines the


most important heading. <h6> defines the least important heading.

ii. <p>:- Defines a paragraph.

iii. <form>:- The <form> tag is used to create an HTML form for user input.

iv. <div>:- The <div> tag defines a division or a section in an HTML


document.The <div> tag is used as a container for HTML elements - which is
then styled with CSS or manipulated with JavaScript.The <div> tag is easily
styled by using the class or id attribute.

v. <input>:- The <input> tag specifies an input field where the user can enter
data.

vi. <script>:- The <script> tag is used to embed a client-side script


(JavaScript).The <script> element either contains scripting statements, or it
points to an external script file through the src attribute.

vii. <br>:- Inserts a single line break.

Javascript attributes used in this program are:

i. document.write(text):- Write into the HTML output stream.


ii. navigator.appName:- The appName property returns the application
name of the browser
iii. navigator.appVersion:-  The appVersion property returns version
information about the browser

iv. navigator.appCodeName:- The appCodeName property returns the


application code name of the browser  

v. navigator.cookieEnabled:- The cookieEnabled property returns true if


cookies are enabled, otherwise false   

vi. navigator.javaEnabled:- The javaEnabled() method returns true


if Java is enabled
vii. navigator.mimeTypes:- to obtain a list of all the MIME types
supported by the browser. The returned object is an array containing
all supported MIME types.

viii. navigator.platform :- The platform property returns the browser


platform (operating system) .

ix. navigator.plugins:- plugins is PluginArray object used to access Plugin


objects either by name or as a list of items  

x. navigator.systemLanguage:- The language property returns the


browser's language.  

xi. navigator.userAgent:-  The userAgent property returns the user-agent


header sent by the browser to the server

Source Code:-

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Aboyt Browser</title>

    <script>

        function show()

  document.write("Name "+navigator.appName+"<br>");

  document.write("Version "+navigator.appVersion  +"<br>");

  document.write("Codename " +navigator.appCodeName  +"<br>");

  document.write("Cookie enable"+navigator.cookieEnabled  +"<br>");
  document.write("Java Enable"+navigator.javaEnabled  +"<br>");

  document.write("Mime type"+navigator.mimeTypes  +"<br>");

  document.write("Platform"+navigator.platform  +"<br>");

  document.write("Plug ins"+navigator.plugins  +"<br>");

  document.write("System Language"+navigator.Language  +"<br>");

  document.write("User language"+navigator.userAgent  +"<br>");

  document.write("User Agent"+navigator.userAgent  +"<br>");

    </script>

</head>

<body>

    <h3>Browser's Information Using Javasript</h3>

    <h4>Click below to find out</h4>

    <form >

        <div>

            <input  type="button" value="Click me" onclick="show()" />

      

        </div>

        </form>

</body>

</html>

Output:-

You might also like