javascript - Show span title on click like on mouseover -
how can show span title on click on span element? in general, span title shown on mouseover. want same when span clicked. how can done?
<span title="abc">def</span>
you can pseudo element.
it's not clear whether 'click' intended mean mouse hold down (:active) or formal 'click' process.
for former, can this.
span { position: relative; } span:active:after { content:attr(title); padding:5px; border:1px solid #ccc; top:5px; right:10%; background: #bada55; }
<span title="abc">def</span>
for latter adding class displays pseudo element obvious solution.
see jsfiddle
Comments
Post a Comment