How to define DO NOTHING in JavaScript

Just have this instead:

onclick="if (confirm('Do you wan to close the application ?')) window.close();"

No point of using the x?y:z if you don't intend to use it "fully".


Try using void(0)

<a href="#" onclick="confirm('Do you wan to close the application ?')?window.close():void(0)')">Close the application ?</a>

try return false; or null

// What should I write in place of DO_NOTHING
    <a href="#" onclick="confirm('Do you wan to close the application ?')?window.close():return false')">Close the application ?</a>

Tags:

Javascript