I am attempting to showcase an XML snippet in my title attribute, similar to the example below.
I understand that removing data-html="true"
or changing it to false
will resolve the issue. However, I also require a label in my title resembling the
<strong style=color:red;>XML Tag: </strong>
Displaying an XML snippet in the title attribute is purely for visual representation and not functional purposes.
- Is there a method to exclude XML tags from the tooltip when using the
data-html
attribute? - Alternatively, is there a workaround to change the color and boldness of my title label without using the
<strong></strong>
tag, allowing me to simply setdata-html
tofalse
?
Desired outcome during hover:
XML Tag:
<note>
XML was crafted to transport data - placing emphasis on what data holds within</note>
$(document).ready(function(){
$('[data-toggle="tooltip"]').tooltip();
});
a{
display:block;
width: 200px;
margin:auto;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
<a href="#" data-html="true" data-toggle="tooltip" data-placement="bottom" title="<strong style=color:red;>XML Tag: </strong><note>XML was designed to carry data - with focus on what data is</note>">Hover to see what is XML</a>