What is HTML ? Advantages and disadvantages of HTML all about html attribute,element,tag

"Advantage and DisAdvantage of HTML" (Hyper Text Markup Language)

"What is HTML"


"HTML" stands for  HyperText Markup language. Basically, HTML is used to mark up a web page by using HTML attributes. Html was created by "Sir Berners-Lee" in 1991. Later on, in 1995 HTML 2.0 was published with some extra specification. After the success of  HTML 2.0 in 1999 HTML 4.0.1 was published. Though HTML 4.01 version is used currently we are having HTML-5 version which is an extension to HTML 4.01, and this version was published in 2012.  

Every language has it own block where we write our code similarly HTML have also it's own block which starts with <HTML> and ends with </HTML>.

Html code is written by the programmer and it is saved as .html or .htm extension and viewed by any respected browser (i.e. Google Chrome, FireFox etc). To learn HTML there is no need backup of any other language. You can easily learn HTML by knowing some tag of HTML and some other basic thing. 

HTML Advantages


As we know that HTML is a markup language which is used for formatting web pages of websites. Here are some advantages and disadvantages of HTML which is following as:

1.HTML can be integrated easily with Javascript, Jquery and CSS.
2.Easy to understand due to a relevant and memorable HTML tag.
3.HTML supported by all browsers (i.e. Google Chrome, Opera Mini, Mozilla Firefox and         many more browser)
4.HTML is light weighted and fast to load.
5.HTML is a free and open source markup language, you don't need to buy a single line of code to design your website.
6.HTML have many tag and attributes which will short your line of code. 

HTML Disadvantages

1. By Html, we can develop only static web pages if you want to develop Dynamic webpages you need the knowledge of some other programming languages like .Net ,Java and also have knowledge of some scripting language (JQuery, JavaScript).
2. Security Features is less in HTML. 

What is HTML Attributes,HTML Tags and HTML Elements

HTML Attributes

HTML attributes are a special type of words which is used to control the element's behavior inside the opening tag. The actual use of HTML attributes is to modify the default functionality of an HTML element.

Here are some different type of HTML attributes
1.Required attribute
2.Optional attribute
3.Standard attribute
4.Event attribute

Example of HTML attributes

<a href="www.example.com">Google</a>
<p align="right">This is Element in HTML</p>


HTML attributes contain Key-Value pair information. In the above example, 'href' is an attribute whereas <a> is an anchor tag, we can say that Tags can also have attributes. HTML attributes contain some extra information for the tag so that we can modify any tag at my end.HTML attributes is just a modifier of HTML element type.

HTM Tag

HTM Tag is a special type of words which contains opening and closing angle bracket(< >). HTML tag example.
Some HTML Tag which is used most during web page development

<p> 
<b> 
<ol>
<ul>
<tr>
<td>
<html>
<figure> 
<button> 
<head> 
<header>
<option>
<progress>
<script>
<table>

HTML Elements 

HTML Elements contains some kind of information which is available with in HTML tag. HTML Element example.

<h1>I am heading as well as HTML elements</h1> 



What is HTML ? Advantages and disadvantages of HTML all about html attribute,element,tag
Advantages and disadvantages of HTML





Read More

Javascript date difference in years with asp.net and Html Control

Introduction

In this tutorial, I am going to show you how you can calculate the "difference between two dates in  years" using javascript asp.net. 


Javascript date difference in years with asp.net and Html Control
Javascript date difference in years


Description
In this Example, I am taking asp.net textBox, if you have HTML textbox, the method of getting value from textbox will be different.


Find date difference using javascript with asp.net
    
    <script type="text/javascript">
        function daysdifference() {
            var dob = document.getElementById('<%=txtdob.ClientID%>').value;
            var doj = document.getElementById('<%=txtdoj.ClientID%>').value;
            var date1 = new Date(doj);
            var date2 = new Date(dob);
            var y1 = date1.getFullYear();
            var y2 = date2.getFullYear();

            var diff = y1 - y2
            if (diff > 18) {
            }
            else {
                alert('Date of joining will be 18 year greater than DOB');
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <table>
                <tr>
                    <td>Date Of Birth</td>
                    <td>
                        <asp:TextBox ID="txtdob" runat="server"></asp:TextBox></td>
                </tr>
                <tr>
                    <td>Date of Joining</td>
                    <td>
                        <asp:TextBox ID="txtdoj" runat="server"></asp:TextBox></td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <asp:Button ID="btn" Text="check" runat="server" OnClientClick="daysdifference()" />
                    </td>
                </tr>
            </table>
        </div>
    </form>
</body>
</html>

 How to find date difference using javascript HTML


<head >
    <title></title>
    <script type="text/javascript">
        function daysdifference() {
            var dob = document.getElementById('txtdob').value;
            var doj = document.getElementById('txtdoj').value;
            var date1 = new Date(doj);
            var date2 = new Date(dob);
            var y1 = date1.getFullYear();
            var y2 = date2.getFullYear();

            var diff = y1 - y2
            if (diff > 18) {
            }
            else {
                alert('Date of joining will be 18 year greater than DOB');
            }
        }
    </script>
</head>
<body>
    <form >
        <div>
            <table>
                <tr>
                    <td>Date Of Birth</td>
                    <td>
                        <input type="text" id="txtdob"  />
                    </td>
                </tr>
                <tr>
                    <td>Date of Joining</td>
                    <td>
                        <input type="text" id="txtdoj" />
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <button onclick="daysdifference()">Click me</button>
                    </td>
                </tr>
            </table>
        </div>
    </form>
</body>
</html>


Read More

Encapsulation In Java With Realtime Example

Introduction to Encapsulation in Java: In this tutorial, I am going to discuss about the "real-time example of encapsulation in java" hope it will helpful for you.

Encapsulation: [A mechanism which is to hide information (Data or Implementation)] Here, the capsule means it is just a container or we can say that a structure that enclose a body part (function or class).

Encapsulation in java with realtime example
Img: Wikipedia



Encapsulation is a process of binding data member (like variables, properties) and member function (like methods) into a single unit. If we talk about class and function it is the best example of encapsulation in java.

In other words, encapsulation is the process of hiding the internal details of an object. We can achieve encapsulation by hiding details using the access modifier (Public, Private, Protected, Default).


class Students          //No matter there is union or struct
{
   
public double totalMarks;  //data, variable or attribute
   public double MarksScored; 

   Public double GetPercentageMarks()      //operation
   {
       double Percentage =(MarksScored /totalMarks) * 100;
       return Percentage;
   }

}

Students OOpsStd = new Students(); 

In the above code we have encapsulated totalMarks, MarksScored and Method GetPercentMarks. While creating a "OOpsStd" object, the implementation of  GetPercentMarks will not be shown.

--------------------------------------------------------------------------------------------------------------------------

A function is also Example of Encapsulation


void add()
{
    int a = 4;
    int b = 5;      //data, variable or attribute
    int  c;

    c =  a + b;       //operation

    cout << "Addtion of 2 no is: " << c;

}   

--------------------------------------------------------------------------------------------------------------


Why we use Encapsulation in java

1) We can control the way of data accessibility.
2) Later on, you can modify the code at your end.
3) Encapsulation in java helps us to achieve loosely couple.
4) The main goal of Encapsulation is to achieve simplicity in our application.
5) Encapsulation in Java allows you to change one part of the code without affecting another part line of code.

Encapsulation in java with real-time example:

Encapsulation in java with realtime example
Img:Wikipedia


Encapsulation play a major role by developing the application the literal meaning of abstraction or the simplest mean of show the operational part or providing the operational part to the use is abstraction and encapsulation is hiding the complexity from the user is set to be the encapsulation 

                                                      or

We can say if there is a encapsulation there will we abstraction if we place an order for mobile to X company customer or  user is only consort for operation the mobile like brightness , volume ,SMS,call,power off he is not caller of the internal component of the mobile like electrical part of handset, how touch screen made he doesn't know that's encapsulation. He only knows functioning part of mobile or operational part of mobile this call abstraction.





Read More