Computer >> Computer tutorials >  >> Programming >> Javascript

How to set the type of quotation marks for embedded quotations with JavaScript?


To set the quotation, use the <q> element. With that, add the type of quotation marks with the quotes property.

Example

You can try to run the following code to set the type of quotation marks for embedded quotations with JavaScript −

<!DOCTYPE html>
<html>
   <body>
      <q id = "myID">Amit</q><br>
      <button onclick = "display()">Update Quotation Marks</button>

      <script>
         function display() {
            document.getElementById("myID").style.quotes = "'\\2039' '\\203A'";
         }
      </script>
   </body>
</html>