Skip to content

🛠️ Avoid Inline JavaScript in Anchor Tags #99

@mather

Description

@mather

Avoid Inline JavaScript in Anchor Tags

The anchor tag at line 153 uses the onclick attribute to trigger JavaScript:

<a onclick="activateTab('policy')">プライバシーポリシー</a>

For better separation of concerns and to enhance security, consider adding an event listener in your script instead of using inline JavaScript. This approach can help prevent potential XSS vulnerabilities and improve code maintainability.

Example:

  1. Add an id or class to the anchor tag:
+               <a id="privacy-policy-link">プライバシーポリシー</a>
  1. In your script, add an event listener:
+     <script>
+         document.getElementById("privacy-policy-link").addEventListener("click", function(event) {
+             event.preventDefault();
+             activateTab('policy');
+         });
+     </script>

Repeat this pattern for other instances where onclick is used within HTML.

Originally posted by @coderabbitai[bot] in #97 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions