Guest User

Untitled

a guest
Jun 20th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. Y.Node.ATTRS.outerHTML = {
  2. getter: function() {
  3. var d = Y.Node.create('<div>'), html;
  4. d.append(this.cloneNode(true));
  5. html = d.get('innerHTML');
  6. delete d;
  7. return html;
  8. },
  9. setter: function(html) {
  10. var node = Y.Node.create(html);
  11. this.replace(node);
  12. return node;
  13. }
  14. };
  15.  
  16. var o = Y.one('#foo').get('outerHTML');
  17. console.log(Y.one('#bar').set('outerHTML', o));
Add Comment
Please, Sign In to add comment