开发者

mootool set value to div

I am using Mootools and I have the following div:

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

I wa开发者_开发百科nt to change this div text but my code is not working:

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

Thanks


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

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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜