<p id="btn">押すがいい</p>
#btn {
  background: #eee;
  display: block;
  padding :  10px;
  width: 100px;
  text-align: center;
  margin: 0 auto;
}

#btn:hover {
  cursor: pointer;
  opacity: 0.7;
}
var btn = document.getElementById('btn');
btn.addEventListener('click', function(e){

//コンストラクタ関数
function Ms (name, spec) {
  this.name = name;
  this.spec = spec;
}
//プロトタイプ拡張 
Ms.prototype.say = function() {
	alert(this.name + "は" + this.spec);
}

//newをつけ忘れる
var zaku = Ms("ザク", "通常の一倍");
 
var shar = Ms("シャアザク", "通常の三倍");
  
var gufu = Ms("グフ", "ザクとは違う");

//下に移動
zaku.say();
shar.say(); 
gufu.say();

}, false);

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.