Originally Posted by felgall
I disagree that there is no point in offering such solutions though.
I said "there is no point in offering the OP
(this is his first post here) advanced/sophisticated solutions."
If he had only the posts in this thread previous to mine to work with, he has not advanced at all in his homework - which you seem to agree.
You are, of course, right that the more sophisticated scripts may (doubless will) be of value to others. But they do not really answer the chap's question.
As so often, I do not consider the fact that one function might execute faster than another to be of the slightest importance when that difference is not discernable. I am not a fanatic - by which I mean a person who insists on very strict standards and shows little tolerance for contrary ideas or opinions. I am a pragmatist - if it works and meets the requirement it will do fine. As Voltaire said, "The best is the enemy of the good". I do not believe in the policy "Never use 10 words where 50 will do", nor "Never use a simple tool where an elaborate one will do". I am not at all sure why your or rnd me's solutions (which are, of course, perfectly valid) are supposed to "better" or "real world". As we often say, there is more than one way to skin a cat.
While many people are still using older browsers, it is pointless to code in such a way that it works only in browsers which support HTML5. In a few year's time - perhaps.