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
img { | |
display: block; | |
} |
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
<!-- 1. Change the addEventListener calls so that the events occur in the following order. | |
the_div! the_item! the_list! --> | |
<div id="the_div"> | |
<ul id="the_list"> | |
<li id="the_item">Click me!</li> | |
</ul> | |
</div> | |
<p id="log"></p> |
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
Number.prototype.isCreditCard = ( | |
function() { | |
var testCC = this.toString(); | |
var sum =0; mul = 1; l = testCC.length; | |
if (l < 19) { | |
for (i = 0; i < l; i++) | |
{ | |
var digit = testCC.substring(l-i-1,l-i); | |
var tproduct = parseInt(digit ,10)*mul; |
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
// ah, wrap the function in parentheses! | |
Number.prototype.times = (function(theString) { | |
this.theString = theString; | |
var result = ""; | |
for (var i = 0; i< this; i++){ | |
result += this.theString; | |
} | |
//return this + " ; " + this.theString; | |
return result; |
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
var Person = function(name) { | |
this.name = name; | |
} | |
Person.prototype.getName = function() { | |
return this.name; | |
} | |
var thomas = new Person("thomas") |
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
var Person = function(name) { | |
this.name = name; | |
} | |
Person.prototype.getName = function() { | |
return this.name; | |
} | |
var thomas = new Person("thomas") |
NewerOlder