0

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";
Álvaro González
  • 142,137
  • 41
  • 261
  • 360
john s
  • 67
  • 1
  • 6

0 Answers0