theniteowl
Programmer
Hi all,
I feel like this may be a silly question but I have never seen any information about it.
When working in HTML, when is it necessary to use quotes in your code?
I have always used quotes around values for parameters but I see SOOO many code examples where they have been left off.
I also find that when I use .innerHTML to grab code from inside a div tag that it is returned without the quotes that were originally in the HTML.
Are quotes only necessary when the value contains spaces?
Is using quotes all the time the correct method?
Is not using quotes supported among all the different browsers?
Anyone have a rundown on this? It's mostly curiosity but it can sure simplify coding when building complex HTML strings through code and having to dance around how to embed the quotes into the string.
TIA.
Nite
Paranoid? ME?? WHO WANTS TO KNOW????
I feel like this may be a silly question but I have never seen any information about it.
When working in HTML, when is it necessary to use quotes in your code?
I have always used quotes around values for parameters but I see SOOO many code examples where they have been left off.
I also find that when I use .innerHTML to grab code from inside a div tag that it is returned without the quotes that were originally in the HTML.
Are quotes only necessary when the value contains spaces?
Is using quotes all the time the correct method?
Is not using quotes supported among all the different browsers?
Anyone have a rundown on this? It's mostly curiosity but it can sure simplify coding when building complex HTML strings through code and having to dance around how to embed the quotes into the string.
TIA.
Nite
Paranoid? ME?? WHO WANTS TO KNOW????