Guest User

Untitled

a guest
Jun 21st, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. function bar(){
  2. return this.html();
  3. }
  4.  
  5. alert($('#foo').bar());
  6.  
  7. jQuery.fn.extend({
  8. bar: function() {
  9. return this.html();
  10. }
  11. });
  12.  
  13. alert($('#foo').bar());
  14.  
  15. function bar() {
  16. return this.html();
  17. }
  18.  
  19. bar.apply($('#foo'));
  20.  
  21. obj = {x: 1};
  22. obj.prototype.bar = function() {return this.x;};
  23. obj.bar();
  24.  
  25. ("#foo")[0].getHtml = function () {
  26. return this.innerHTML;
  27. };
  28. alert($("#foo")[0].getHtml());
Add Comment
Please, Sign In to add comment