クリックした後、ハイパーリンクを削除しようとしています。(ページ付け)
ハイパーリンクを削除したいのですが、それでもテキストを表示します。
<a href='#'>1</a>
<a href='#'>2</a>
<a href='#'>3</a> //remove the hyperlink but keep number 3.
<a href='#'>4</a>
<a href='#'>5</a>
助けてくれてありがとう。
クリックした後、ハイパーリンクを削除しようとしています。(ページ付け)
ハイパーリンクを削除したいのですが、それでもテキストを表示します。
<a href='#'>1</a>
<a href='#'>2</a>
<a href='#'>3</a> //remove the hyperlink but keep number 3.
<a href='#'>4</a>
<a href='#'>5</a>
助けてくれてありがとう。
$('a').click(function(){
$(this).removeAttr("href");
});
$('a').click(function(e){
e.preventDefault(); // if you need it
$(this).contents().unwrap();
});
http://api.jquery.com/contents/
http://api.jquery.com/unwrap/