document.querySelector('p').onfocus = function() { alert('фокус'); } 
 <p>текст</p> 

    1 answer 1

    You can, only first for p you need to set the tabindex :

     document.querySelector('p').onfocus = function() { console.log('фокус'); } 
     <p tabindex="-1">текст</p>