Posts Tagged ‘HTML Element’
Setting HTML attributes easily with Ext JS
Well a short time since i last blogged I know, sorry about that… hello facebook readers – if there are any!
This wasn’t immediately obvious to me when I first started using the Ext JS library, but there is a really neat way of setting HTML attributes.
Firstly we need a DOM element to play with…(assuming you have got a simple page to play around with…)
var my-div = Ext.get('my-element');
then we go about setting its attributes…
my-div.set({
class : 'rounded-corners',
title : 'This is my example div'
});
Of course you could do the whole code in one call
Ext.get('my-element').set({
class : 'rounded-corners',
title : 'This is my example div'
});
Either way you choose I think its a really nice way of setting attributes…