I want to write some JavaScript that will change the onmousedown div at runtime. Thus, when loading the mouse on the div will do one thing, and if the JavaScript function is called the mouse down, then the div will do something else. Is it possible?
You can simply set the onMouseDown property.
document.getElementById('myDiv').onmousedown = function() { alert('New mouse down handler.'); };
Keep in mind that javascript properties are case sensitive. "onmousedown" is all lowercase.
Source: https://habr.com/ru/post/1277481/More articles:Is it time to try merb? - ruby ββ| fooobar.comHow do I know if Windows just recovered from BSOD? - windowsiphone β connecting to the real world - iphoneAccepting client certificates from any CA - sslStandard connection libraries for MySQL, MSSQL and Oracle in PHP - databaseC # save user settings in database - c #How to serialize System.Configuration.SettingsProperty - serializationCall User32 API in .NET. - .netC ++ Strategy Design Pattern creating an interface array - c ++Linking to a specific version of a shared library on Linux - linuxAll Articles