Recently, I came across a tooltip code on Stack Overflow which I have been using. The issue I am facing is that the text in the title section is hardcoded and I need to customize it for different labels. How can I modify the code to make it flexible enough to work with any label and display a unique title text?
<div class="form-group">
@Html.LabelFor(model => model.Name, new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.Name)
<span class="label label-primary mytooltip">?</span>
@Html.ValidationMessageFor(model => model.Name)
</div>
</div>
Below is the current script being used
$(document).ready(
function () {
$(".mytooltip").tooltip({
animation: "true",
placement: "right",
title: "Tooltip texts....",
trigger: "hover"
});