🚀 Is building a website too difficult? Let me guide you step by step—Learn about the 「Naibabiji WordPress Website Building Coaching Service」 →

Implement one-click filling of website comment box information without using a Plugin

Website owners who frequently visit blogs must have encountered situations where some websites' comment boxes do not save personal information, such asNaibabijithis. So, before each comment, you have to manually input or select historical information from the autofill data. Although it doesn't require typing, it's still troublesome. Naiba previously used the browser's autofill feature, but it wasn't very convenient either. Now, I'll share a very convenient method for automatically filling personal information in comment boxes.

One-Click Fill Code

javascript: void
function() {
    var lauthor = ["#author", "input[name='comname']", "#inpName", "input[name='author']", "#ds-dialog-name"],
    lmail = ["#mail", "#email", "input[name='commail']", "#inpEmail", "input[name='email']", "#ds-dialog-email"],
    lurl = ["#url", "input[name='comurl']", "#inpHomePage", "#ds-dialog-url", "input[name='url']"];
    for (i = 0; i < lauthor.length; i++) {
        var author = document.querySelector(lauthor[i]);
        if (author != null) {
            author.value = '你的名字';
            break
        }
    }
    for (j = 0; j < lmail.length; j++) {
        var mail = document.querySelector(lmail[j]);
        if (mail != null) {
            mail.value = '你的邮箱';
            break
        }
    }
    for (k = 0; k < lurl.length; k++) {
        var url = document.querySelector(lurl[k]);
        if (url != null) {
            url.value = '你的网址';
            break
        }
    }
    return ! 1
} ()
Please modify the above content with your own information and copy it to the clipboard.

Add the Code as a Bookmark

Find any bookmark, or simply press CTRL + D to bookmark this article. Then, right-click on the bookmark, select 'Edit.' If you're unsure, refer to the animated demonstration below.一键填充The first part of the animated demonstration above shows the effect, while the latter part demonstrates how to modify the bookmark content. The content inside the quotes in lauthor, lmail, and lurl corresponds to the id, class, or tag of the input elements in the comment box. If you encounter a blog website where autofill doesn„t work, you can right-click “Inspect Element„ and adjust the code based on the relevant changes in the input elements of the comment box for each blog site! This method is from:xcnte

🚀 Still feeling confused after reading the tutorial? Let me guide you step-by-step instead.

「Naibabiji WordPress Website Building Coaching」 — From selecting a domain and purchasing hosting to installing themes and publishing posts, I「ll guide you through every step, helping you avoid detours and reach your goals directly.

👉 Learn about Website Building Coaching Service
🔒

Comments are closed

The comment function for this article is closed. If you have any questions, please feel free to contact us through other channels.

×
二维码

Scan to Follow