views:

173

answers:

2

i am using mootools

i have div in body with like this

      <div class="total-title">12</div>

total-title i am using for reference.

my mootools code is

      $('total-title').set('text', 'text goes here');

i want to change text of above div.

this is not working...?

Thanks

A: 

You have given your div a class, no an ID, so the following:

$$('.total-title').set('text', 'text goes here');
jrista
Thank you vary much, i am new to mootools that's why ....
air
Its a little different from jQuery. The $() function only supports finding elements by ID. You have to use the $$() function to find elements by CSS selectors. Once you get that through your brain, mootools is great to use.
jrista
A: 

I suspect that for a element you want to set the "html" property, not the "text" property.

Pointy