File: div3.js

package info (click to toggle)
keepassxc-browser 1.8.4%2Brepack1-7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,488 kB
  • sloc: javascript: 8,405; makefile: 16; sh: 11
file content (24 lines) | stat: -rw-r--r-- 902 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
'use script';

document.getElementById('toggle3').addEventListener('click', function(e) {
    const loginForm = document.getElementById('loginForm');

    if (!loginForm) {
        const dialog = document.createElement('div');
        dialog.setAttribute('id', 'loginForm');

        const usernameInput = document.createElement('input');
        usernameInput.setAttribute('type', 'text');
        usernameInput.setAttribute('name', 'loginField');
        usernameInput.setAttribute('placeholder', 'username');
        dialog.append(usernameInput);

        const passwordInput = document.createElement('input');
        passwordInput.setAttribute('type', 'password');
        passwordInput.setAttribute('name', 'passwordField');
        passwordInput.setAttribute('placeholder', 'password');
        dialog.append(passwordInput);

        e.currentTarget.parentElement.appendChild(dialog);
    }
});