English 中文(简体)
我能否把这变为仅仅使用一个地址链接?
原标题:Can I convert this to just use an address link?

I have this:

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

我是否可以改用地址标签?

问题回答

Sure, just write it thus:

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

then in your JS:

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

可在上填写:

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

但是,你 t倒了,因为它把你的联合材料与你的标记混在一起。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签