finalText = $('<div/>').text(finalText).html();

31 views
Skip to first unread message

Hamburger

unread,
Oct 2, 2012, 9:16:39 AM10/2/12
to mootool...@googlegroups.com
Hello,
I need some help to translate jquery to mo.
What is the $('<div/>') in
finalText = $('<div/>').text(finalText).html();
Does it create a div?

the complete code is here:
https://github.com/freqdec/slabText/blob/master/js/jquery.slabtext.js  Line: 142

thx in advance

Arian Stolwijk

unread,
Oct 2, 2012, 9:22:27 AM10/2/12
to mootool...@googlegroups.com
Yes, $('<div/>') creates a new div element, same as new Element('div') in MooTools.

So that code would be like:

finalText = new Element('div', {text: finalText}).get('html');

Hamburger

unread,
Oct 2, 2012, 9:45:18 AM10/2/12
to mootool...@googlegroups.com
thx Arian for the fast answer
Reply all
Reply to author
Forward
0 new messages