<!DOCTYPE html> <html lang="en"> <head> <title>Assignment 8</title> </head> <link rel="shortcut icon" href="#"> <body> <h1>Assignment 8 <br>Ritik Singh_1901220130084(IT-43)<br>Answer 1.</h1> </body> <script> let arr=[1,2,3,4,8,9,10] console.log(arr) arr.push(11) console.log("after using push function \n",arr) arr.pop(10) console.log("after using pop fucntion\n",arr) arr.reverse() console.log("after using reverse function \n ",arr) arr.shift() console.log("after using shift function\n",arr) arr.sort() console.log("after using sort function \n",arr) arr.splice(1,1,23) console.log("after using splice function \n",arr); </script> </html> <!DOCTYPE html> <html lang="en"> <head> <title>Assignment 8</title> <link rel="shortcut icon" href="#"> </head> <body> <h1>Assignment 8 <br>Ritik Singh_1901220130084(IT-43)<br>Answer 2.</h1> </body> <script> var d=new Date(); console.log("today's calendar is") console.log("Date:",d.getDate(),"-", d.getMonth(),"-",d.getFullYear()) console.log("Time:",d.getHours(),":", d.getMinutes(),":",d.getSeconds()) </script> </html> <!DOCTYPE html> <html lang="en"> <head> <link rel="shortcut icon" href="#"> <title>Assignment 8</title> </head> <body> <h1>Assignment 8 <br>Ritik Singh_1901220130084(IT-43)<br>Answer 3.</h1> </body> <script> let arr=[1,2,3,4,5,6,7,8] console.log("initial array is=",arr) arr.push(50) console.log("after adding 50 \n ",arr) arr.pop(50) console.log("after deleting 50 \n :",arr) arr.reverse() console.log("reversed array is:\n",arr) arr.shift() console.log("after removing first element of the array:\n",arr) arr.sort() console.log("array in incresing order: \n ",arr) </script> </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>