Time spent in forums: 2 Months 3 Weeks 6 Days 20 h 4 m 36 sec
Reputation Power: 1092
You can put double quotes in single quotes, you can put single quotes in double quotes, or you can escape the inner quotes (with & quot; or &34; ). Depending on the HTML flavor, you can even leave out the attribute quotes completely. But you cannot put single quotes in single quotes or double quotes in double quotes. Like I said, this applies to every mainstream language, so it shouldn't really surprise you.
or any other combination that fulfills the requirements above.
Time spent in forums: 1 Month 2 Weeks 4 Days 5 h 31 m 49 sec
Reputation Power: 2725
The premise is simple, cssbonding. In layman's terms: A machine reads in sequence. Take the following code:-
- HTML4Strict Code
<element onclick="someFunction("a string");">
Using the forums built-in highlighting, do you see how the machine is going to interpret that code? It takes the first double quotation mark as the opening point of your parenthesis and then it takes the second as the closing point, then repeats when it finds a second set of quotation marks. It does not understand your intent, only syntax and logical order.
By using the following examples of single and double quotation marks, you are differentiating between your parenthesis, allowing you to nest them inside one another.