I want a div to just call a function(not move my position on the page) but instead of calling my JavaScript function - it moves my location on the page
what am I doing wrong? (running inside of joomla)
Why is my JavaScript function not being called in my div?
http://....com/test.php#p3
<div id="p1" onclick="testFunction()">
</div>
<div id="p3">Some content</div>
<script type="text/javascript">
testFunction();
</script>
</div>
<script type="text/javascript">
function testFunction() {
alert("Test");
}
</script>
scripttags above thatdiv.testFunctionis called in a script block before it is declared in another scriptUncaught ReferenceError: testFunction is not defined#p3in the URL? The meaning of a hash in the URL is to scroll to that element.