keepassxc-browser/tests/scripts/div3.js

25 lines
902 B
JavaScript
Raw Permalink Normal View History

2022-03-18 12:24:01 +00:00
'use script';
2022-03-18 14:10:36 +00:00
document.getElementById('toggle3').addEventListener('click', function(e) {
2022-03-18 12:24:01 +00:00
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);
2022-03-18 14:10:36 +00:00
e.currentTarget.parentElement.appendChild(dialog);
2022-03-18 12:24:01 +00:00
}
});