How to create DOM elements from string (pass from ajax) in Mootools?
In jQuery a simple solution is $( elements )
var elements = '<i>This is italic</i><b>this bold</b>...';
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Without a string, you would use the Element class:
With a string, you can check how it’s one in Request.HTML, see here.
Basically Mootools elements & DOM elements are the same, this is another SO questions which creates DOM nodes from HTML: Creating a new DOM element from an HTML string using built-in DOM methods or prototype
From old Mootools forums, I found an interesting idea too: add a new method Element.fromString() or String.toElement() which would contain this logic.