in line hover style code example
Example: how to apply hover through inline css
document.head.insertAdjacentHTML('beforeend', '<style>#mydiv:hover{color:red;}</style>');
document.head.insertAdjacentHTML('beforeend', '<style>#mydiv:hover{color:red;}</style>');