Categories




PreviousNext
function for document.getElementById()    
 Send mail Views:253
Belongs to : Javascript
Facebook Bookmarkbookmark this page Digg Bookmark Delicious BookmarkStumbleupon Bookmarkshare with orkut Post to Google Buzz

function for document.getElementById():

Always try to shorten your coding, so that you will be able to understand it in future.

Use a function for document.getElementById(), so that it will avoid you each and everytime typing the line "document.getElementById('something').innerHTML/style/value/something else...."

For Eg,
function d(s){
return document.getElementById(s);
}


Just call the function as,
d('test').style.border="1px solid green";


Thus this way of coding shortens your line of code.......Razz

Pictures and Videos
Online Calculators
embed code


By - Ramya, On - 2010-02-05
Send This
PreviousNext

User Comments


Add NEW Feedback:

Name :     Email :

 Server Monitoring Web hosting by Hiox India Privacy Policy Terms and Conditions