Reputation: 187
I have a question. How can i disable href from inner element of div when href is placed in the parent element? Maybe I try to visualize it:
<span class='img' href="someLink">
<div class="main">
<h2 contenteditable="true">Some txt</h2>
</div>
</span>
I want to disable href
function from <h2>
(because I want to edit it by clicking on them, now as you know I am redirecting to href url), and left it in other html elements. How can i do that? Is there any option to do it using only html tag(s)? Or the only one option is to use js / jQuery? Can u give me an example or solution?
Upvotes: 0
Views: 1111
Reputation: 12864
You can do it like this :
<h2 contenteditable="true" onclick='return false;'>Some txt</h2>
Upvotes: 1