Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
    
    <div id="test"></div>
    
    
</body>
</html>
 
function Quick () {
   this.getById = function(id) {
      return document.getElementById(id);       
   };
   this.doSomethingElse = function(id) {
      return this.getById(id).nodeName;
   };
}
var x = new Quick();
//console.log( x.getById('someid') ); // It works, logs the complete HTMLElement DOM Object
console.log( x.doSomethingElse("test") ); // "DIV"
Output

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

Dismiss x
public
Bin info
roXonpro
0viewers