I need to add tags
data
to my button
when I hover over it, I already get the mouse hover
move now I need to add the tags
, which are:
data-trigger="hover"
data-toggle="popover"
data-placement="bottom"
data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus."
data-original-title="Popover Title"
Then my button at the end should look like this:
<button class="btn btn-primary" data-trigger="hover" data-toggle="popover"
data-placement="bottom"
data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus."
title="" data-original-title="Popover Title">
Meu botão
</button>
The$(this)
accessesthebutton'sgift.ButIneedtoputthelinkintagspan
asintheimageabove.
Mycodelookslikethis:
eventMouseover:function(event,jsEvent,view){$(jsEvent).attr("data-trigger","hover");
$(this).attr("data-toggle","popover");
$(this).attr("data-placement","bottom");
$(this).attr("data-content","Vivamus sagittis lacus vel augue laoreet rutrum faucibus.");
$(this).attr("ata-original-title","Popover Title");
}
I need the attributes to be added to the child of $(this)
because $(this)
is tag a
, and what you need to receive is the child of a
, span