开发者

mootool set value to div

开发者 https://www.devze.com 2022-12-08 07:00 出处:网络
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:

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

精彩评论

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

关注公众号