I'm trying to override all 'a' tags in a document with a specific class to prevent their default behavior and send a javascript alert. Here is my code so far:
$('.specific-class').click(function (event) {
event.preventDefault();
event.onclick('alert("hello world")');
});
This code stops the links from firing, as it should, but it doesn't send my 'hello world' message.
Does anyone know the appropriate syntax to make the alert fire when the links are clicked? Let me know if I can provide any additional information!