Website Design United States, Website Design California, Website Designing United States, Website Designing California

Getting the Browser Handle to an Object in One Function - JavaScript

A function which accesses the browsers method of accessing objects on the current DOM and returning it.
You can use it like:

Should work with most newer and older browsers :-)

function getBrowserMethod(id) {
if(document.getElementById) {
var obj= document.getElementById(id);
return obj;
}
else if(document.all) {
var obj = document.all.id;
return obj;
}
else if(document.layers) {
var obj = document.id;
return obj;
}
}

WEB DESIGN INDIA
42 B Malviya Nagar , New Delhi-110017

Skype: manmeetsi
Email: support.webdesignindia@gmail.com
Tel: 91-011-40502005, 9810067295

 















 


© 2008-2009 dotnet4all.com