Skip to content

Instantly share code, notes, and snippets.

function FruitTree(){
this.height = 0;
this.age = 0;
this.fruitCollection = [];
this.dead = false;
}
function Fruit(){}
FruitTree.prototype.grow = function(){
function Comment(author, text){
this.form = "<form id='new_comment'><textarea></textarea><input name='author' id='authorName' type='text'><input type='submit' value='submit' id='submitButton'></form>";
this.author = author;
this.text = text;
};
Comment.prototype.addToPage = function() {
$('#comment_list').append("<li>" + this.text + "<span class='author'>" + this.author + "</span></li>");
$('#new_comment').replaceWith('<button id="new_comment_button">New Comment</button>');
};