code_junkie

how do I use the node Builder from Scriptacolus to insert html

Nov 10th, 2011
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. var html = "<p>This text is <a href=#> good</a></p>";
  2. var newNode = Builder.node('div',{className: 'test'},[html]);
  3. $('placeholder').update(newNode);
  4.  
  5. var a = Builder.node('div').update("<a href='#'>foo</a>")
  6.  
  7. var a = Builder.node('div', {'class':'cool'},
  8. [Builder.node('div', {'class': 'another_div'})]
  9. );
  10.  
  11. var a = new Element('div').insert(
  12. new Element('div', {'class': 'inner_div'}).update("Text in the inner div")
  13. );
Add Comment
Please, Sign In to add comment