Does .onclick = function(){ (js) work when the item is clicked? I apologize for the stupid question, I just don’t want to later rewrite a very large part of the frontend.
.onclick = function(){
html
Yes, it will work when you click on any element in principle, except that if another handler is registered to this element, then the behavior of your handler may be unpredictable (not always).
It works like this:
document.querySelector('div').onclick = function() { console.log('Я есть Div') }
<div> asd </div>
Source: https://ru.stackoverflow.com/questions/825955/More articles:autoresize textarea to MaterializeSSL and not SSL on ApacheAdding excel sheets with rubyComputer tic-tac-toeZ-Order Markers for ClusteringTracking C ++ window switchingHow to make the transmitted props component state?How to get the text that is after the tags?Is it possible to intercept a field from an initialized parent?Textarea activity when a button is pressedAll Articles