KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Obtaining element references in JavaScript
PRODUCT: 4D Web 2.0 Pack | VERSION: 1.0 | PLATFORM: Mac & Win
Published On: May 7, 2008

PLEASE NOTE: This Tech Tip applies to all versions of 4D Web 2.0 Pack

Here are two ways to obtain element references in JavaScript:

document.getElementById('elementID')



The above method is the conventional way to go about obtaining the element reference.

When using the 4D Ajax Framework, there is a function that obtains the same result:

$('elementID')



This will return the element reference based on the element ID provided.