document.write(''); var constructors = { HTML: 'Html', HEAD: 'Head', LINK: 'Link', TITLE: 'Title', META: 'Meta', BASE: 'Base', ISINDEX: 'IsIndex', STYLE: 'Style', BODY: 'Body', FORM: 'Form', SELECT: 'Select', OPTGROUP: 'OptGroup', OPTION: 'Option', INPUT: 'Input', TEXTAREA: 'TextArea', BUTTON: 'Button', LABEL: 'Label', FIELDSET: 'FieldSet', LEGEND: 'Legend', UL: 'UList', OL: 'OList', DL: 'DList', DT: 'Span', DD: 'Span', DIR: 'Directory', MENU: 'Menu', LI: 'LI', DIV: 'Div', P: 'Paragraph', H1: 'Heading', H2: 'Heading', H3: 'Heading', H4: 'Heading', H5: 'Heading', H6: 'Heading', Q: 'Quote', PRE: 'Pre', BR: 'BR', BASEFONT: 'BaseFont', FONT: 'Font', HR: 'HR', INS: 'Mod', A: 'Anchor', IMG: 'Image', OBJECT: 'Object', PARAM: 'Param', APPLET: 'Applet', MAP: 'Map', AREA: 'Area', SCRIPT: 'Script', TABLE: 'Table', CAPTION: 'TableCaption', COL: 'TableCol', TBODY: 'TableSection', THEAD: 'TableSection', TFOOT: 'TableSection', TR: 'TableRow', TD: 'TableCell', TH: 'TableCell', FRAMESET: 'FrameSet', FRAME: 'Frame', IFRAME: 'IFrame', SPAN: 'Span', FIELDSET : 'FieldSet' }; //pour la Classe HTMLElement if(typeof HTMLElement == 'undefined') var HTMLElement = function(){}; //Pour les sousClasses HTMLXxxElement ou Xxx est contenu dans le tableau constructor for(var j in constructors) { var constructorName = 'HTML'+ constructors[j] +'Element'; if(eval('typeof ' + constructorName +' == \'undefined\'')) eval('var ' + constructorName + ' = function(){}'); } HTMLElement.prototype.foo = function() { alert(this.tagName) }; var test = window.document.getElementById('ola').foo();