I would like to write a (Javascript?) function to be included in HTML pages that allows me to render the function arguments tagged as kbd separated by “+”s and able to take an arbitrary number of input arguments.
So, for example, fnRenderKBD(Ctrl+X, Y, Z) would render as Ctrl+X+Y+Z.
The important thing is that the function should be able to take a variable number of arguments.
Is it possible to write such a function (if so, how)? I have next to no knowledge of JS.
My answer at the bottom is not the best thing I have ever written. A better solution would look something like:
Demo: http://jsfiddle.net/wPg7z/
Something like this should work:
Demo: http://jsfiddle.net/gTYxP/1/