How to display for slash as a string in javascript HTML

Created at 27-Jul-2021 , By samar

How to display for slash as a string in javascript HTML

We’ll attempt to use programming in this lesson to solve the "How to display for slash as a string in javascript HTML" puzzle.

You can display for slash as a string in an HTML page while using the javascript onclick method in the input element.
  • Display forward slash (/) as string in HTML page using character escape in Javascript

    <a href="javascript:void(0)" onclick="getVideoFile('video/\*');"> Anchor </a>
    

    Sometimes you have to pass the forward-slash (/) as a parameter value to the method in HTML. You have to pass the backslash after the forward-slash while passing it as a string to the method in javascript. The backslash (\) escape character turns special characters into string characters.  Here we have to show ('video/*') as a string.

Back to code snippet queries related javascript

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Buy Me A Coffee

Don't forget to share this article! Help us spread the word by clicking the share button below.

We appreciate your support and are committed to providing you valuable and informative content.

We are thankful for your never ending support.