dom - Is it safe to modify the document Object in javascript? -



dom - Is it safe to modify the document Object in javascript? -

i'm wondering if can modify document object this, guarantee existence of document.getelementsbyclassname(), or if there limitation on modifying document in browsers:

if(typeof document.getelementsbyclassname !== 'function') document.getelementsbyclassname = function(class_name){ // custom function };

yes, can. document object behaves every other object in javascript, it's extensible.

javascript dom object

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -