I'm trying create a bootstrap tooltip in a button in javascript.
This is what I'm trying to achieve:
<input type="image" src="~/images/icon_trash_red.png" class="m-l-20" onclick="RemoveItem(this)" height="20" data-toggle="tooltip" data-placement="right" title="Remover aluno" />
This is what I have so far:
button = document.createElement("Input");
button.src = "/images/icon_trash_red.png";
button.width = '20';
button.type = 'image';
button.onclick = function () {
RemoveItem(this);
};
button.style.marginLeft = '70px';
button.title = "Remover aluno";
button.setAttribute("data-toggle", "tooltip");
The 'setAttribute' seems to be working fine, because if I change to something like this: button.setAttribute("height", "50px"); it works.
Any ideas what I'm doing wrong?