You noticed that using target="_blank" for external links redirects users but may pose a security risk. How can you mitigate this risk while maintaining the functionality?
- Add a JavaScript onclick event.
- Remove the target attribute altogether.
- Use only internal links.
- Use rel="noopener noreferrer" with the anchor tag.
When using target="_blank", the new page can potentially gain access to the window object of the original page through the window.opener property, posing a potential security risk. Adding rel="noopener noreferrer" to the anchor tag prevents this behavior, protecting users from any potential security vulnerabilities.
Loading...
Related Quiz
- The CSS property ______ is used to remove space between the borders of adjacent table cells.
- You noticed a section of HTML code commented out which includes a script tag. How might this affect the webpage, and how would you verify it?
- You are tasked with enhancing the accessibility of a form that includes multiple select lists. What specific HTML elements, attributes, and ARIA roles would you utilize to ensure that the form is navigable and usable by individuals using screen readers?
- HTML comments within the _____ tag might provide additional information about external resources.
- The ____ attribute in the img tag can be utilized to display text while the image is loading.