single quotations vs double quotations

28 Views Asked by At

I'm working in javascript trying to understand when to use single quotations vs double quotations. I have noticed that when I put '' in html and then put "" in javascript for working with DOM it still works. when do I choose single quotations and when do I choose double quotaions?

ex html :

<p id='p1'>list of fruits</p>

ex javascript:

document.getElementById("p1").textContent = "Short list of fruits";
0

There are 0 best solutions below