Skip to content

Instantly share code, notes, and snippets.

View chiragmongia's full-sized avatar

Chirag Mongia chiragmongia

View GitHub Profile
@chiragmongia
chiragmongia / arr-flatten.js
Last active June 1, 2016 12:22
Javascript: flatten function on Array
// Defining flatten method on array
Array.prototype.flatten = function () {
var result = [];
(function arrayFlatten(arr) {
arr.forEach(function(element) {
element.constructor === Array ? arrayFlatten(element) : result.push(element);
})
})(this);
return result;
<!DOCTYPE html>
<html>
<head>
<style>
.main_menu {
list-style-type: none;
font-family: "Georgia";
font-style: italic;
font-size: 18px;
padding:0px 20px;
<!DOCTYPE html>
<html>
<head>
<style>
.main_menu {
list-style-type: none;
font-family: "Georgia";
font-style: italic;
font-size: 18px;
padding:0px 20px;
<!DOCTYPE html>
<html>
<head>
<style>
.main_menu {
list-style-type: none;
font-family: "Georgia";
font-style: italic;
font-size: 18px;
padding:0px 20px;
<!DOCTYPE html>
<html>
<head>
<style>
.main_menu {
list-style-type: none;
font-family: "Georgia";
font-style: italic;
font-size: 18px;
padding:0px 20px;
<!DOCTYPE html>
<html>
<head>
<style>
.main_menu {
list-style-type: none;
font-family: "Georgia";
font-style: italic;
font-size: 18px;
padding:0px 20px;
<!DOCTYPE html>
<html>
<head>
<style>
.main_menu {
list-style-type: none;
font-family: "Georgia";
font-style: italic;
font-size: 18px;
padding:0px 20px;
<!DOCTYPE html>
<html>
<head>
<style>
#header {
background-color: #b2e7ff;
font-family: "tahoma";
font-size: 24px;
color: black;
text-align: center;
<!DOCTYPE html>
<html>
<head>
<style>
#heading {
font-family: "Tahoma";
font-size: 18px;
color:#2c286d;
}
<!DOCTYPE html>
<html>
<head>
</head>
<body bgcolor="#F2F2F2">
<h1 align="center">HTML form exercise</h1>
<p>
<font color="red">Please note:</font> This Example demonstrates how HTML forms can be used. Submit button should submit the button and reset button should reset the form(revert the changes in form fields). The form layout should be the same as below.
</p>
<b>Contact form</b>