I am trying to apply some javascript code in an external website code editor. I am calling a simple onmouseover
function from a div to give an alert but it does not work here is the code: error: ReferenceError: clickme is not defined
<script type="text/javascript" charset="utf-8">
document.addEvent('domready', function(){
try {
function clickme(){alert('?');}
} catch(e) {
console.log('ERR: '+e)
}
})
</script>
<div onmouseover="clickme()">Click me</div>
I have to use document.addEvent('domready', function(){
.
Does anyone has any solution how can i use a function inside try-catch
and document.addEvent('domready', function()
?