Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

User:HashJona/common.js: Difference between revisions

From Growtopia Wiki
Created page with "$(function() { $("a.no-blank").on("click", function(event) { if ($(this).attr("target") === "_blank") { event.preventDefault(); // Optionally open in the same tab window.location = $(this).attr("href"); } }); });"
 
mNo edit summary
Line 1: Line 1:
$(function() {
$(function() {
        $("a.no-blank").on("click", function(event) {
    $("span.no-blank-traget").each(function() {
            if ($(this).attr("target") === "_blank") {
    $(this).closest("a").removeAttr("target");
                event.preventDefault();
    });
                // Optionally open in the same tab
                window.location = $(this).attr("href");
            }
        });
});
});

Revision as of 11:22, 9 March 2025

$(function() {
    $("span.no-blank-traget").each(function() {
    	$(this).closest("a").removeAttr("target");
    });
});