<html> <title> </title> <body> <h3>Date and Time</h3> <pre> <script> const d=new Date(); document.writeln("<p>cureent sytem date: </p>"+d); const d1= new Date(2004,10,08,12,35,45,354); document.writeln("<p>Birthday Date: </p>"+d1); const d2=new Date(-100000000); document.writeln("<p>Mlliseconds mathod</p>"+d2); const d7=new Date("2/3/2004") document.writeln("<p>String method</p>"+d7) </script> </pre> <h3>Date object Methods</h3> <pre> <script> const d3=new Date(); document.writeln("Year is: "+d3.getFullYear()); document.writeln("Month is :"+d3.getMonth()); document.writeln("Minutes:"+d3.getMinutes()); document.writeln("Date is: "+d3.getDate()); document.writeln("Hours "+d3.getHours()); document.writeln("Seconds:"+d3.getSeconds()); document.writeln("Milliseconds:"+d3.getMilliseconds()); </script> </pre> <h3>Predefined function </h3> <pre> <script> const d4=new Date(); let day=d4.getDate(); let month=d4.getMonth()+1; let year=d4.getFullYear(); document.writeln("Today Date is: "+day+"/"+month+"/"+year); </script> </pre> <pre> <script> const d5=new Date(); alert(d5); </script> </pre> <h3>Set the date and time </h3> <pre> <script> const d6=new Date(2004, 10,08,12,35,45,354); d6.setFullYear(d6.getFullYear()+1) document.writeln("After setting the Year :"+d6.getFullYear()); d6.setMonth(d6.getMonth()+10) document.writeln("After setting the Month :"+d6.getMonth()); d6.setDate(d6.getDate()+23) document.writeln("After setting the Date :"+d6.getDate()); d6.setHours(d6.getHours()+3) document.writeln("After setting the Hours :"+d6.getHours()); d6.setMinutes(d6.getMinutes()+16) document.writeln("After setting the Minutes :"+d6.getMinutes()); d6.setSeconds(d6.getSeconds()+19) document.writeln("After setting the Seconds :"+d6.getSeconds()); d6.setMilliseconds(d6.getMilliseconds()+1987675940376) document.writeln("After setting the Milliseconds :"+d6.getMilliseconds()); </script> </pre> </body> </html>
Write, Run & Share HTML code online using OneCompiler's HTML online Code editor for free. It's one of the robust, feature-rich online Code editor for HTML language, running on the latest version HTML5. Getting started with the OneCompiler's HTML compiler is simple and pretty fast. The editor shows sample boilerplate code when you choose language as HTML
. You can also specify the stylesheet information in styles.css
tab and scripts information in scripts.js
tab and start coding.
HTML(Hyper Text Markup language) is the standard markup language for Web pages, was created by Berners-Lee in the year 1991. Almost every web page over internet might be using HTML.
<!DOCTYPE html>
<html>
and ends with </html>
<h1>
to <h6>
where <h1>
is the highest important heading and <h6>
is the least important sub-heading.<p>..</p>
tag.<a>
tag.
<a href="https://onecompiler.com/html">HTML online compiler</a>
<img>
tag, where src
attribute consists of image name.<button>..</button>
tag<ul>
for unordered/bullet list and <ol>
for ordered/number list, and the list items are defined in <li>
.<a href="https://onecompiler.com/html">HTML online compiler</a>
CSS(cascading style sheets) describes how HTML elements will look on the web page like color, font-style, font-size, background color etc.
Below is a sample style sheet which displays heading in green and in Candara font with padding space of 25px.
body{
padding: 25px;
}
.title {
color: #228B22;
font-family: Candara;
}
<table>
tag.<tr>
tag<th>
tag<td>
tag<caption>
tag<script>
is the tag used to write scripts in HTML<script src="script.js"></script>