Prev Demo
JavaScript
>
Inserting Special Characters
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <h1>Inserting special characters inside the string.</h1> <div id="myId"></div> <script> var a = 'TechFunda is \'obviously\' good.'; var b = "This flight is \"absolutely\" full."; var c = "TechFunda \\vs\\ DotNetFunda."; document.getElementById("myId").innerHTML = a + "<br>" + b + "<br>" + c; </script> <p><strong>Note:</strong> Observe the variable values (String) in the script code in code box, we can get the idea of how to insert special characters inside a string.</p> </body> </html>
Note: We DO NOT save your trial code in our database.
Output