Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Closed] How to create nonclickable anchor tag? ?? Reply To: [Closed] How to create nonclickable anchor tag? ??

#142070
TheDoc
Member

If you want a clickable element for JS, don’t use an anchor element if it’s not meant to go anywhere. Simply use a <span> and add cursor: pointer; in the CSS.

HTML:

<span></span>

CSS:

.something-meaningful {
    cursor: pointer;
}

JS:

$('.something-meaningful').click( function () {
  // do something
});