Double & Single Quotation Marks

Scripts are quote important. Always match them up. If a double quotation mark is used, make sure there is a second one at the end. If a single quotation mark, be sure there is a second one at the end as well. It is okay to put double quotes inside single quotes or single quotes inside double. The main point is to watch the quotation marks pattern in each script. Both of the following lines are acceptable:

onClick="location.href='page.html'"
onClick='location.href="page.html"'

Good habit It might be easier to keep straight if the double quotes are placed on the outside and single quotes on the inside, so that the doubles surround the singles. This hierarchical thinking might help to line up the single quote with single and double quotes with double.
Back Table of Contents Next