I am trying to print what my function returns with use of alert() but I somehow cannot do it. I so something like this :
<a href="#" onclick="alert(' javascript:XORFunction('hello', 'patr') ')" />hello </a>
I have also tried with document.write like this :
document.write( javascript:XORFunction('hello', 'pat') );
What am I doing wrong ?
You don’t need the “javascript:” part because it’s already inside a javascript block.
<a href="#" onclick="alert(XORFunction('hello', 'patr'))">hello </a>