-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
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:
- Add an
idorclassto the anchor tag:
+ <a id="privacy-policy-link">プライバシーポリシー</a>- 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
Labels
No labels