$$plugins.define('password', function (element, options) { var input = element.previousElementSibling; element.addEventListener("click", function (e) { e.preventDefault(); if (input.type === 'password') { input.type = 'text'; element.classList.add('disabled'); } else { input.type = 'password'; element.classList.remove('disabled'); } }); });