SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
-
Mar 1, 2007, 06:02 #1
- Join Date
- Oct 2006
- Posts
- 16
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Defining methods for html elements
Hello,
how can i define method for an html element, for example:
element.getElementById(), element.setAttribute ...
thanks..
-
Mar 1, 2007, 06:08 #2
- Join Date
- Mar 2001
- Posts
- 3,537
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Code:element.greeting = function() { alert("hello world"); }
Code:element.greeting = myFunc; function myFunc() { alert('hello world'); }
Bookmarks