Reputation: 663
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
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