MIMI
MIMI

Reputation: 663

Can I convert this to just use an address link?

I have this:

<input id="doCheck" type="button" onclick="doCheck('temp'); return false;" />

Can I convert to use the address tag?

Upvotes: 1

Views: 38

Answers (1)

Alnitak
Alnitak

Reputation: 339816

Sure, just write it thus:

<a id="doCheck" href="#">

then in your JS:

$(function () {
    $('#doCheck').click(function(e) {
         e.preventDefault();
         doCheck('temp');
    }
});

You could actually write it:

<a id="doCheck" href="#" onclick="doCheck('temp'); return false;" />

but you shouldn't, because it mixes your JS with your markup.

Upvotes: 1

Related Questions