/** * Body data of a Modal Dialog Box * all setters are chainable. * * @author Jeff O'Toole */ var DialogContent = function() { /** * Allows this object to play nicely with jQuerys $(this) context object */ var self = this; /** * Content Properties */ this.title; this.content; /** * Sets the Title property * @param title string * @return DialogContent */ this.setTitle = function(title) { self.title = title; return self; } /** * Gets the Title Property */ this.getTitle = function() { return self.title; } /** * Sets the Content property * @param content string * @return DialogContent */ this.setContent = function(content) { self.content = content; return self; } /** * Gets the Content Property */ this.getContent = function() { return self.content; } } // Build Dialog Content var dialogContent = new DialogContent(); // Load Object dialogContent.setTitle("COOL") .setContent("NEATO"); // Test Object alert(dialogContent.getContent() + ' ' + dialogContent.getTitle());