Login
Congrats in choosing to up-skill for your bright career! Please share correct details.
Home / Blog / Interview Questions / Hypertext Markup Language (HTML) Interview Questions & Answers
Bharani Kumar Depuru is a well known IT personality from Hyderabad. He is the Founder and Director of AiSPRY and 360DigiTMG. Bharani Kumar is an IIT and ISB alumni with more than 17 years of experience, he held prominent positions in the IT elites like HSBC, ITC Infotech, Infosys, and Deloitte. He is a prevalent IT consultant specializing in Industrial Revolution 4.0 implementation, Data Analytics practice setup, Artificial Intelligence, Big Data Analytics, Industrial IoT, Business Intelligence and Business Management. Bharani Kumar is also the chief trainer at 360DigiTMG with more than Ten years of experience and has been making the IT transition journey easy for his students. 360DigiTMG is at the forefront of delivering quality education, thereby bridging the gap between academia and industry.
Table of Content
HTML is designed based on SGML(Standard Generalized Markup Language) however XHTML is based on XML XHTML is the integration of XML application with HTML Web page which are designed using HTML are considered to be as static whereas dynamic when it is created using XHTML Nowadays all browsers supports XHTML (that does not mean it does not support HTML) In XHTML rules(syntax) are very strict and need to follow the same. Example: Doctype which is very much necessary to mention at the beginning of the file). However it is not so strict in HTML NOTE: Errors in HTML are referred to as bad HTML when browsers cannot handle it properly on small devices like mobile But, XHTML has an added feature of XML which properly makes a webpage. XHTML is a combination of HTML and XML
DOM is an API that is language-independent(written on some and called by several other programming languages) and cross-platform(which is designed to work on several other platforms) It supports a service-oriented API provided with remote procedure calls and web services DOM helps in viewing the documents as a tree-like structure the tags in HTML file are treated as objects and defines properties, methods, and events. It helps in modifying the objects without affecting the other objects. Easy to retrieve the values(properties, methods, events) by using objects than through tags. Hence DOM helps in adding, changing, or deleting the HTML elements. Below code snippet illustrate how you can use the document object to access and manipulate HTML elements Finding HTML Elements (Ex: document.getElementById(id)) Changing the innerHTML Element (Ex: element.innerHTML = new HTML content) Add a HTML Element (Ex: document.appendChild(element)) Create a HTML Element(Ex: document.createElement(element)) Remove a HTML Element(Ex: document.removeChild(element)) NOTE: Accessing the document object is nothing but accessing element in an HTML page.
The correct syntax for a web address is scheme://prefix.domain:port/path/filename, where, -> scheme / protocol is for https(secured) or http, -> Hostname (prefix+domain+portnumber) -> prefix is for domain like www, -> domain denotes domain name, -> port defines port number, -> path defines path at server, -> filename is for name of the document. Example: http(s)://www.example.com/index.html, which indicates 1. protocol (http/https), 2. below are under Domains or Hostname a. Sub-Domain name (www) b. Name of the Domain (example) c. Top Level Domain(com) 3. file name(path to the file)(index. html).
HTML Web storage provides us to store the data within the browser locally Data was stored in cookies before HTML5 which was not that much secured. The storage limit is also better when compared to cookies and the limit is up to 5MB where the stored information is never shared with the server. There is no expiration date for the data and more over the data stored is secured by storing a large amount of data. There are two types of web storage as follows: 1. Local Storage: This uses the "localStorage" object to store the data permanently (until you remove it will be there) 2. Session Storage: This uses the "sessionStorage" object to store the data temporarily (disappears when the browser or current tab is closed) Example: window.localStorage - data is stored without an expiry date window.sessionStorage - data is stored for one session (when the browser is closed, the data will be lost)
HTML is easy to learn, understand and implement. It does not require any additional tools to develop a webpage It is best fitted and understood by all Browsers. It does not have any complications in Editing during update or any changes. It is easy to integrate with other languages It is termed as basic for all the other programming languages.
Didn’t receive OTP? Resend
Let's Connect! Please share your details here