I have string $html = ' <button onclick="js_func(this, "in this point")"> submit </button>' I want to send a string to js function I am trying with '/'' string '\' also with "/"" string "\" but didn't get the solution yet. Please guide me with correct solution.
Asked
Active
Viewed 37 times
0
Mohsin
- 179
- 4
- 13
2 Answers
2
Just escape it with a backslash as simple as this:
$html = ' <button onclick="js_func(this, \'in this point\')"> submit </button>'
VisioN
- 143,310
- 32
- 282
- 281
0
With \==> ' < button onclick="js_func(this, \"in this point\")"> submit < /button>'
Romain capelleman
- 56
- 4