Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
finished
- Loading branch information
Steve Cartagena
authored and
Steve Cartagena
committed
Feb 27, 2017
1 parent
7ed2c2c
commit 5d3dac8
Showing
3 changed files
with
117 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,46 @@ | ||
<!doctype html> | ||
<html class="no-js" lang=""> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="x-ua-compatible" content="ie=edge"> | ||
<title></title> | ||
<meta name="description" content=""> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
<link rel="apple-touch-icon" href="apple-touch-icon.png"> | ||
<!-- Place favicon.ico in the root directory --> | ||
|
||
<link rel="stylesheet" href="css/normalize.css"> | ||
<link rel="stylesheet" href="css/main.css"> | ||
<script src="js/vendor/modernizr-2.8.3.min.js"></script> | ||
</head> | ||
<body> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="x-ua-compatible" content="ie=edge"> | ||
<title></title> | ||
<meta name="description" content=""> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
<link rel="apple-touch-icon" href="apple-touch-icon.png"> | ||
<!-- Place favicon.ico in the root directory --> | ||
|
||
<link rel="stylesheet" href="css/normalize.css"> | ||
<link rel="stylesheet" href="css/main.css"> | ||
<script src="js/vendor/modernizr-2.8.3.min.js"></script> | ||
</head> | ||
<body> | ||
<!--[if lt IE 8]> | ||
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> | ||
<![endif]--> | ||
|
||
<!-- Add your site or application content here --> | ||
<p>Hello world! This is HTML5 Boilerplate.</p> | ||
|
||
<script src="https://code.jquery.com/jquery-1.12.0.min.js"></script> | ||
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.12.0.min.js"><\/script>')</script> | ||
<script src="js/plugins.js"></script> | ||
<script src="js/main.js"></script> | ||
|
||
<!-- Google Analytics: change UA-XXXXX-X to be your site's ID. --> | ||
<script> | ||
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]= | ||
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date; | ||
e=o.createElement(i);r=o.getElementsByTagName(i)[0]; | ||
e.src='https://www.google-analytics.com/analytics.js'; | ||
r.parentNode.insertBefore(e,r)}(window,document,'script','ga')); | ||
ga('create','UA-XXXXX-X','auto');ga('send','pageview'); | ||
</script> | ||
</body> | ||
</html> | ||
<![endif]--> | ||
|
||
<!-- Add your site or application content here --> | ||
<p id="item"> | ||
|
||
</p> | ||
|
||
<div id="container"> | ||
|
||
</div> | ||
|
||
<script src="https://code.jquery.com/jquery-1.12.0.min.js"></script> | ||
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.12.0.min.js"><\/script>')</script> | ||
<script src="js/plugins.js"></script> | ||
<script src="js/main.js"></script> | ||
|
||
<!-- Google Analytics: change UA-XXXXX-X to be your site's ID. --> | ||
<script> | ||
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]= | ||
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date; | ||
e=o.createElement(i);r=o.getElementsByTagName(i)[0]; | ||
e.src='https://www.google-analytics.com/analytics.js'; | ||
r.parentNode.insertBefore(e,r)}(window,document,'script','ga')); | ||
ga('create','UA-XXXXX-X','auto');ga('send','pageview'); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* 1) | ||
Write a function that calcuates and RETURNS the product of two | ||
numbers. I should be able to use the function like the code below: | ||
*/ | ||
function getProduct(num1, num2) { | ||
result = num1 * num2 | ||
return result | ||
} | ||
|
||
var prod = getProduct(5,8); | ||
console.log(prod+5); | ||
|
||
/* 2) | ||
Write a Javascript function that takes TWO parameters: element and class. | ||
The element should be a DOM object, NOT a string. The class can be a string. | ||
The function should add the designated class to the element. The code below should work */ | ||
function addClassToElement(ele, cl) { | ||
ele.className += " " + cl; | ||
} | ||
|
||
// function fancyLog(text, element) { | ||
// console.log(text); | ||
// // Now what goes in here? | ||
// var element = document.createElement(element); | ||
// element.innerHTML = text; | ||
// document.querySelector("#log").appendChild(element); | ||
// } | ||
|
||
var p = document.getElementById("item"); | ||
addClassToElement(p, "class1"); | ||
|
||
/* 3) | ||
A function that creates any type of element given, adds content to it, and adds it to the page in an intended parent. The code below should work. The PARENT should be a DOM object, not a selector. */ | ||
|
||
function addItemToParent(ele, text, parent) { | ||
var ele = document.createElement(ele); | ||
ele.innerHTML = text; | ||
parent.appendChild(ele); | ||
} | ||
|
||
var parent = document.getElementById("container"); | ||
addItemToParent("h1", "This is some content",parent); |