Share button without an href



We are trying to add the Share button to our site but cannot use <a href

I tried to change it to e.g. <span id

But this did not work - are there any alternatives that will work?



You can use the iframe notation described here:

I’m curious- why can’t you use an anchor with a href? It’s a very common HTML element.


We would just prefer it to not use that method based on internal reasons.

I read somewhere in a blog comment the a href part is not needed, is there a way to do it without the iframe method and not an href?


You can try leaving the href attribute out of the anchor element, but I’m not sure whether the button Javascript will identify the link correctly, and you’re removing the fallback for users without Javascript enabled.


Ok - is there any other way than to use an empty then - like some kind of span or div etc


A quick test verified that leaving the href out works:


Or is the anchor element completely out of the question? I really don’t understand why your platform would not allow iframes or anchors, but allows script includes. If you can give me some background on why you’re being limited, maybe I can help come up with an alternative.


I want share button without an href.


I’m a mobile developer. We do not use <a> tags. We use a completely javascript based logic for links. This is not that unusual. iFrames are simply out of the question. How do I build a twitter button without an <a> tag? Must I rewrite your javascript? Is there an API? Thanks.


I just wrote my own script, it is probably easier.


There’s a way to add the official buttons using Javascript:


Its possible with Span id in twitter framework. .!