I'm working with a simple markup that triggers a colorful bootstrap tooltip when hovering over a button in the body. Currently, the tooltip text is hardcoded into the jQuery function. I want to find a way to pass the tooltip text to the jQuery function from the button markup instead. How can this be achieved? (keep in mind that this will eventually be ASP.NET markup)
<html>
<title>toolTips</title>
<head>
<script type="text/javascript" src="jqueryScripts\jquery-2.1.0.js"></script>
<script type="text/javascript" src="jqueryScripts\bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="jqueryScripts\bootstrap-combined.min.css">
<style type="text/css">
.red-tooltip + .tooltip > .tooltip-inner {background-color: #f00;}
.red-tooltip + .tooltip > .tooltip-arrow { border-bottom-color:#f00; }
</style>
<script type='text/javascript'>
$(
function(){
$('#userNameField').tooltip({
'placement': 'bottom',
'title': "...this is a test tooltip..."
});
});
</script>
</head>
<body>
<input type="submit" class="red-tooltip" id="userNameField" value="button1">
</body>
</html>