I've got a span tag:
<span id="myBtnfb"
class="demo" onclick="open()">
<span class="icon"> </span>
<span class="">Testing</span>
</span>
and some javascript
function open() {
alert('Hello');
}
Now, what I want to happen is when the span is clicked, it fires the function "open". What seems to happen though is it just reloads the page but brings back a blank page. Any ideas?
onLoad
- change it to run not wrapped in<head>
(so it is exposed globally) and change the name of the function