6th Day
- Hey Guys Welcome to my 6th day of Blog writing, I'm glad to share with you ,We have installed Visual Studio Code in 6.1 and if you have any problem in installation the you can share with me through comments.
we will make SIMPLE UI IN HTML.
We are using here IIFE Concept
Output:
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>
To know in more detail to this concept. click here
Thank You....
No comments:
Post a Comment