I'd like to have a function which would return one or more variables connected to element, for example return color of specified border or borders (would use jQuery to it):
$('element').borderColor(); // should return "red, blue, green, orange"
$('element').borderColor('left'); // should return "red"
$('element').borderColor('left', 'right'); // should return "red, green"
and so on.
Here's example: http://jsfiddle.net/DkGpP/
Question 1: How should I construct part of script (which is actually if/else) to return only what I want (actually $('element').borderColor('left', 'right'); still showing only "red")?
Question 2: Can arguments in my function can be called without apostrophes like:
$('element').borderColor(left);
$('element').borderColor(left, right);
if yes, how to rebuild it (actually show "undefined"). Does it demand to build a function like:
jQuery.fn.borderColor = function(left, top, right, bottom) {
?
I'll be grateful for help.

leftandrightare treated as variables, and their values are used as the parameters. If you haven't assigned them, the values areundefined.