Skip to content | Skip to navigation

Blog
what's happening

A few thoughts and ideas, a little sharing of information & some interesting information on what we're up to and what we're building for our clients. Remember to add our RSS feed to your last of feeds!

We'll contact you

Contact form
Customer logo
Twitter icon


Recent blogs

Popular blog tags

SI Works blogs by tag 'Prototype' (1)


How about selecting an element, changing its properties, inner HTML or attributes, then from he same snip updating another element that is up or down from it by navigating through to DOM effectively.

$('element').up(0).down("a").writeAttribute("title", "new title");

Which will translate the following in plain english:

Navigate to the element with the name if "element".then move up to the parent of that element.then more to the next a tag within that parent element.then change the title attribute of that element.

Neat huh?

update:I forgot to mention, using the $$ and A$ functions, for instance.

$$('.classname')

simply will grab all the elements in the DOM document that has a class "classname"BUT, then what to do with it.

$A($$('.classname'))

this, however will now group them into an array, at which time we can then perform an action on each of then using the each command.

$A($$('.classname')).each(function(e){
// dom something 
})

Ps...The framework is MUCH more effective and efficient, which allows us to build even MORE robust applications for our clients.

Digg it!Add to your del.icio.usAdd to TechnoratiTweet this postShare this on facebook