-3

How can I insert quotes in a string, anchor tag? I am adding link using tag in my application of node.js. It is not accepting.

How to overcome that? And what is the reason it doesn't accept that?

"<A HREF="index.html">";
Jayram
  • 18,820
  • 6
  • 51
  • 68
  • possible duplicate of [Escaping Strings in JavaScript](http://stackoverflow.com/questions/770523/escaping-strings-in-javascript) – Jayram Jul 05 '13 at 09:14

2 Answers2

1

You can escape quotes in string literals :

var s = "<A HREF=\"index.html\">";
Denys Séguret
  • 372,613
  • 87
  • 782
  • 758
0

Two methods are there

First method

var s = '<A HREF="index.html">';

Second Method

escape quotes in string literals :

var s = "<A HREF=\"index.html\">";

Thirumalai murugan
  • 5,698
  • 8
  • 32
  • 54