var $ = function( id ) { return document.getElementById( id ); };
$( 'someID' )
Here I used $
, but you can use any valid variable name.
var byId = function( id ) { return document.getElementById( id ); };
byId( 'someID' )
More Related Contents:
- Does ES6 introduce a well-defined order of enumeration for object properties?
- Asynchronous Process inside a javascript for loop [duplicate]
- How can I determine the direction of a jQuery scroll event?
- How to get function parameter names/values dynamically?
- Dynamically load JS inside JS [duplicate]
- Get class list for element with jQuery
- Use JavaScript to place cursor at end of text in text input element
- What is the cleanest way to get the progress of JQuery ajax request?
- How to detect window.print() finish
- ECMAScript 6 features available in Node.js 0.12
- Return positions of a regex match() in Javascript?
- Using Chrome, how to find to which events are bound to an element
- window.location.reload with clear cache [duplicate]
- Does .css() automatically add vendor prefixes?
- jQuery Deferred and Dialog box
- How can I change the title of the document during .ready()?
- Firebase JS API auth – account-exists-with-different-credential
- Convert Hex to RGBA
- Is “localStorage” in Firefox only working when the page is online?
- JavaScript event registering without using jQuery
- How to unbind a specific event handler
- Excel to JSON javascript code?
- Function.prototype is a function
- Reason for using array notation when defining AngularJS Controller
- How to download a csv file using PhantomJS
- How to display file name for custom styled input file using jquery?
- Setting onclick to use current value of variable in loop [duplicate]
- Uncaught ReferenceError: myFunction is not defined
- Key for javascript dictionary is not stored as value but as variable name
- How to get text box value in JavaScript