Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<html>
<body>
        <div class="Area">
            <input type="image" id="Area-Light" src="http://www.psdgraphics.com/file/glossy-light-bulb.jpg" width=200/>
            <p class="imgtxt" ">Area-Light</p>
        <hr/>
</body>
</html>
 
function my_stateButton(   canvasName )
{
    this.canvas = document.getElementById(canvasName);
    this.canvas.onmousedown = this.onMouseDown;
    this.canvas.onmouseup = this.onMouseUp;
  console.log('constructing statebutton for id '+canvasName);
    // Do some work
}
my_stateButton.prototype.onMouseDown = function() {
   alert('down');
};
my_stateButton.prototype.onMouseUp = function() {
   alert('up');  
};
var btn1 = new my_stateButton( "Area-Light");         
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
phdphilpro
0viewers