mrspoonzy at gmail Cube by Noah Ellman A powerful javascript toolkit, in research © by Noah Ellman

Jwee API > Dom wee.dom

wee.dom id(...)

The wee.dom toolkit contains functions related to the document.

function string element_id )
Get element by ID. This is the same as wee() and the $() function if enabled.
  1. An HTML element's ID, such as "#header". The # sign is NOT required.
Returns{element} The single element or false if invalid
function wee.dom.tag(...)( string tag )
Get elements by HTML tag name.
  1. HTML tag, such as "div" or "p".
Returns{array} The selected elements

var divs = Dom.tag('div');
// This would get all the DIV elements
//  on the page in an array.
function string selector )
Get elements by CSS selector, the same as jQuery() way.
  1. {string} Valid CSS selector, using #id, .class, and tag names.
Returns{array} The selected elements"form#myForm input");"#header a.navLink");
NotesSelecting is processed by the browser, which is much more effecient. However, CSS3 or non-compliant selectors will not work reliably.

This is one of the most fundamental functions. You need to be knowledgable of CSS selector syntax to use this function and its benefits.

// Access only the list items 
// inside a div with the id of "tabs" "div#tabs li" );

// Access all A links inside paragraphs
// that are within a box with id="content""#content p a")

// This code below shows resets the value
// of every INPUT box with the class of "textbox"

$("form input.textbox") ).each(
	function() {
		this.value = '';	

Tech Note:
Until the most recent generation of browsers, this feature required massive code libraries to be loaded, such as one called sizzle, which is what jQuery uses. Now, with browsers supporting the function natively (called document.querySelectorAll() ), these libraries are not needed. Using native query selecting means thousands of lines of code can be avoided. JWee uses native query selecting because of these new benefits. However, for user's with older browsers, Jwee will dynamaically load the Sizzle engine behind the scenes and use it instead.

>> The Sizzle library ( was created by the Dojo Foundation.

function wee.dom.body()
Get the document's BODY tag
Returns{element} BODY element


// Usage Example
Dom.body().setStyle( 'fontsize', 15 )
function wee.dom.head()
Get the document's HEAD tag
Returns{element} HEA element


// Usage Example
var el = Eleml.create( 'script' );
Dom.head().appendChild ( el );
function wee.dom.clientHeight()
Get document (page) height
function wee.dom.clientWidth()
Get document (page) width
function wee.dom.scrollTop()
Get the window's scroll position
function wee.dom.scrollLeft()
Get the window's scroll position
boolean wee.dom.loaded
Status (or readyState) of the page. Greater then 0 means DOM is rendered.

Possible values:

  • 0 - If page is not loaded at all
  • 1 - If page is ready but images still downloading
  • 2 - If page is completely loaded
  • 3 - If page has been loaded for several seconds

Discussion on /learn/api/wee-dom

itoa('1135173802') 10/06/16 :  

Post a message

Xymon 11/05/14 :  

Jwee comes in handy on the javascript/html5 gaming framework i'm working on. Specifically wee.dom.

Xymon 11/05/14 :  

That's because I moved it to the /resource/ folder.

Xymon 11/05/14 :  

$("div.content") ).each( function() { this.innerHTML='This handles all div tags with the class of "content". '; } );

Xymon 11/05/14 :  

You can also just copy/paste the javascript documents to your computer by visiting the index of

Xymon 11/05/14 :  

TheDoctor: I'd say he's probably fully aware of the downloader not working. I'll help you out though, go to In this text document you'll find a list of script tags, add these to the head tag of your document to use them, you can also download them all manually by visiting each source.