CREATING A SIMPLE UI IN HTML 6.2

           6th Day 

        Friends we have already know that about IIFE concept so using this concept
         we will make SIMPLE UI IN HTML
                    We are using here IIFE Concept
                   
Using this concept we are making objects in UI.  
                   
This is the whole process of creating a simple UI                 
  <html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // We are using here IIFE Concepts.
       var customerNameSpace= (function(){
          function _Customer (){
              _name="";
              _address="";
              _add = function(){
                  alert(_name +""+_address);
              }
              return{
            
             add:_add
              }
              
          }
          return{
                  Customer:_Customer
              }
        })();
        // Here we are making objects
        function CreateCustomer(){
        var Customer=new customerNameSpace.Customer();
        Customer.name ="Raushan";
        Customer.add();
        Customer.add();
        alert(this.name);

        }
        
    </script>
   Customer Name <input type="text" name="" id="txtName"><br> 
   Customer address <textarea name="" id="" cols="30" rows="10"></textarea><br>
   <input type="button" value="Add Customer"onclick="CreateCustomer()"><br>
</body>
</html>

Output: 

To know in more detail to this concept. click here


Thank You....






          

No comments:

Post a Comment