Gags' Blog

Pages

  • Home
  • Tutorials
  • Dice Games
  • Code Snippets
  • Circuits
Showing posts with label Code Snippets. Show all posts
Showing posts with label Code Snippets. Show all posts

April 4, 2013

Code Snippet: getById

In a simple JavaScript project that does not use JQuery or other third-party libraries, I find this to be a nice shortcut for document.getElementById():

function getById(id) {
    return document.getElementById(id);
}
Posted by Unknown at 6:49 AM No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: Code Snippets, JavaScript
Older Posts Home
Subscribe to: Posts (Atom)

My Sites

  • @ptrgags (Twitter)
  • Gags' Blog (Tumblr)
  • GagsDev
  • GagsDev (Facebook)
  • GagsDev (Google+)

Blog Archive

  • ▼  2014 (25)
    • ▼  September (2)
      • The Road Ahead
      • Sig Figs Explained
    • ►  August (8)
    • ►  July (13)
    • ►  June (2)
  • ►  2013 (8)
    • ►  June (1)
    • ►  May (2)
    • ►  April (5)
  • ►  2012 (34)
    • ►  October (1)
    • ►  August (2)
    • ►  July (6)
    • ►  June (5)
    • ►  May (11)
    • ►  April (9)
  • ►  2011 (3)
    • ►  November (3)

Labels

Arduino Photos Circuits Camping Fractals Sticky Note Sketches Tutorials Processing Chaos Theory Stories Articles BBB BeagleBone Black ChipKit Doctor Who Double Exposure GIMP Teensy++ Dice Games Drawings LEDs Physics Roguelike Serial Communication Soldering Story: Amnesia ASCII Art Code Snippets D8 Adventures GagsDev GagsRPG Isometric JavaScript Light Linux Microsoft Word New York Propeller Quotes Rules Sticky Note Sketches+ Thermostat Vectors college
Simple theme. Powered by Blogger.