Careful, now - not every element defaults to display: inline. Setting the display to a null string uses the browser default for the type of element. This is especially thorny when you're dealing with table parts.
@Jake:
One best-practice you might want to start getting into is avoiding cluttering the global (window) namespace. Every time you do a
function blap (foo) { alert( "Your code here." ) };
you're actually attaching that function to the window object. Better might be something like this:
var Codestore = {
toggle: function(foo,bar) { ... },
waffle: function(baz) { ... },
baffle: function(bling) { ... }
};
You would call this by using Codestore.toggle("b0rp", true);
Besides slightly better memory performance, you also get a little bit of organization. And, you don't have to worry about some other programmer hogging the global name "toggle" on you.
@Michael:
Careful, now - not every element defaults to display: inline. Setting the display to a null string uses the browser default for the type of element. This is especially thorny when you're dealing with table parts.
@Jake:
One best-practice you might want to start getting into is avoiding cluttering the global (window) namespace. Every time you do a
function blap (foo) { alert( "Your code here." ) };
you're actually attaching that function to the window object. Better might be something like this:
var Codestore = {
toggle: function(foo,bar) { ... },
waffle: function(baz) { ... },
baffle: function(bling) { ... }
};
You would call this by using Codestore.toggle("b0rp", true);
Besides slightly better memory performance, you also get a little bit of organization. And, you don't have to worry about some other programmer hogging the global name "toggle" on you.