Reputation: 179
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.
Upvotes: 0
Views: 39
Reputation: 56
With \
==> ' < button onclick="js_func(this, \"in this point\")"> submit < /button>'
Upvotes: 0
Reputation: 145478
Just escape it with a backslash as simple as this:
$html = ' <button onclick="js_func(this, \'in this point\')"> submit </button>'
Upvotes: 2