Last Updated : Jan 1, 2023
- First, we write <! DOCTYPE html> which we used as an instruction to the web browser about what version of HTML file is written in.
- Secondly, the <html> tag is used to indicate the beginning of an HTML document.
- As above now <head> tag is used to contain information about web page. In this tag a <title> tag is used which helps us to specify a webpage title. Both <head> and <title> tags are Paired tags. So, both have </head> and </title> ending tags respectively.
- Here, then we create a body tag. All the content which we want to show on browser’s screen or display is always written inside this codes.
- Here, as we see in body we create a form with id form and inside this we create an input type text with value msg. and after that we create a button with type submit and we display text Submit to it also.
- Here, as you see we first target form with help of its id and remove the prevent default means the action that occur on form by its nature like submit button. After that we use Ajax to send form data.
- Now, let us discuss another file that is create using php. Here we directly assigns value to variable and use mail function to send email data.
- At last, the <body> and <html> tags are closed with </body> and </html> respectively.